Skip to content
Browse files

Move error spec into its own section

  • Loading branch information...
1 parent 06963c1 commit cb53676c042d3f0a624899d5d235850b6fbed84d @ConradIrwin committed Jul 2, 2011
Showing with 17 additions and 10 deletions.
  1. +17 −10 spec/client_spec.rb
View
27 spec/client_spec.rb
@@ -96,16 +96,6 @@
@connection.receive_data "* RUBY0001 OK Success\r\n"
end
- it "should fail all concurrent commands if something goes wrong" do
- a = b = false
- @client.create("Encyclop\xc3\xa6dia").errback{ |e| a = true }
- @client.create("Brittanica").errback{ |e| b = true }
- @connection.should_receive(:close_connection).once
- @connection.fail_all EOFError.new("Testing error")
- a.should == true
- b.should == true
- end
-
describe "login" do
it "should callback on a successful login" do
a = nil
@@ -151,4 +141,21 @@
end
end
end
+
+ describe "multi-command concurrency" do
+ before :each do
+ @client = EM::IMAP::Client.new(@connection)
+ @connection.receive_data "* OK Ready to test!\r\n"
+ end
+
+ it "should fail all concurrent commands if something goes wrong" do
+ a = b = false
+ @client.create("Encyclop\xc3\xa6dia").errback{ |e| a = true }
+ @client.create("Brittanica").errback{ |e| b = true }
+ @connection.should_receive(:close_connection).once
+ @connection.fail_all EOFError.new("Testing error")
+ a.should == true
+ b.should == true
+ end
+ end
end

0 comments on commit cb53676

Please sign in to comment.
Something went wrong with that request. Please try again.