Skip to content

Commit

Permalink
fix duplication of events in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Oct 4, 2012
1 parent dd735b8 commit 2d8b877
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/test_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ def sample(event, &block)
results = []
event.each do |e|
filters.each do |filter|
next if e.cancelled?
filter.filter(e)
results << e unless e.cancelled?
end
results << e unless e.cancelled?
end

filters.select { |f| f.respond_to?(:flush) }.each do |filter|
event = filter.flush
results += event if event
Expand Down

0 comments on commit 2d8b877

Please sign in to comment.