Skip to content
Browse files

Merge pull request #20 from reinh/fix-time-related-test-failure

Remove sleeps from #time specs to try to prevent failures
  • Loading branch information...
2 parents 4a028fa + 8ec7c3d commit 1dc4613fd7652197e90dc22fd96b665f25013653 @reinh committed Sep 6, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 spec/statsd_spec.rb
View
10 spec/statsd_spec.rb
@@ -113,21 +113,21 @@ class Statsd
describe "#time" do
it "should format the message according to the statsd spec" do
- @statsd.time('foobar') { sleep(0.001); 'test' }
- @socket.recv.must_equal ['foobar:1|ms']
+ @statsd.time('foobar') { 'test' }
+ @socket.recv.must_equal ['foobar:0|ms']
end
it "should return the result of the block" do
- result = @statsd.time('foobar') { sleep(0.001); 'test' }
+ result = @statsd.time('foobar') { 'test' }
result.must_equal 'test'
end
describe "with a sample rate" do
before { class << @statsd; def rand; 0; end; end } # ensure delivery
it "should format the message according to the statsd spec" do
- result = @statsd.time('foobar', 0.5) { sleep(0.001); 'test' }
- @socket.recv.must_equal ['foobar:1|ms|@0.5']
+ result = @statsd.time('foobar', 0.5) { 'test' }
+ @socket.recv.must_equal ['foobar:0|ms|@0.5']
end
end
end

0 comments on commit 1dc4613

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