Skip to content

Commit

Permalink
loosen up the connecion tests slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
stve committed Jul 15, 2012
1 parent b366835 commit c3f8774
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions spec/em-twitter/connection_spec.rb
Expand Up @@ -55,7 +55,7 @@
EM::Timer.new(10) { EM.stop } EM::Timer.new(10) { EM.stop }
end end


count.should == 100 count.should >= 100
end end
end end


Expand All @@ -76,21 +76,19 @@
after { Mockingbird.teardown } after { Mockingbird.teardown }


it 'emits each complete response chunk' do it 'emits each complete response chunk' do
count = 0
responses = [] responses = []


EM.run do EM.run do
client = EM::Twitter::Client.connect(default_options) client = EM::Twitter::Client.connect(default_options)
client.each do |message| client.each do |message|
count += 1
responses << message responses << message
EM.stop if count >= 100 EM.stop if responses.size >= 100
end end


EM::Timer.new(10) { EM.stop } EM::Timer.new(10) { EM.stop }
end end


count.should == 100 responses.size.should >= 100
responses.last.should eq('{"foo":"bar"}') responses.last.should eq('{"foo":"bar"}')
end end
end end
Expand Down

0 comments on commit c3f8774

Please sign in to comment.