Skip to content

Commit

Permalink
better test for collect
Browse files Browse the repository at this point in the history
  • Loading branch information
telent committed Apr 22, 2012
1 parent 40ff1c6 commit 5e22ca5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/unit/monitor_test.rb
Expand Up @@ -105,13 +105,15 @@ def initialize(hash)
end
collect :fiftyhz, :class=> v
listen :tick do
i||=0
p = Math::sin(i * Math::PI/36)
@i||=0
p = Math::sin(@i * Math::PI/36)
self.collection[:fiftyhz] << p
i+=1
@i+=1
end
end.new
10.times do |i| m.notify :tick end
assert_equal 10,m.collection[:fiftyhz].length
assert_in_delta 3.70773, m.collection[:fiftyhz].reduce(:+)
end
end
end
Expand Down

0 comments on commit 5e22ca5

Please sign in to comment.