Permalink
Browse files

spec for StatWatcher on_change ArgumentErrors; create a new loop as t…

…he default seems to be leaking into the TimerWatcher test
  • Loading branch information...
1 parent def56dd commit f01eaf0171173674d22ecc17513facc676f054d3 @rares rares committed Feb 10, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 spec/stat_watcher_spec.rb
@@ -19,7 +19,7 @@ def on_change(previous, current)
end
def run_with_file_change(path)
- reactor = Cool.io::Loop.default
+ reactor = Cool.io::Loop.new
sw = MyStatWatcher.new(path)
sw.attach(reactor)
@@ -69,4 +69,9 @@ def delete_file(path)
watcher.previous.ino.should eql(watcher.current.ino)
end
+ it "should raise when the handler does not take 2 parameters" do
+ class MyStatWatcher < Cool.io::StatWatcher; def on_change; end; end
+ lambda { watcher.accessed }.should raise_error(ArgumentError)
+ end
+
end

0 comments on commit f01eaf0

Please sign in to comment.