Permalink
Browse files

Using cache mode for the collector fsevents stream.

  • Loading branch information...
1 parent 8158ca9 commit 3c75f619cb1e8f69605811668ad337aeebf13397 @ymendel committed Jun 30, 2008
Showing with 7 additions and 2 deletions.
  1. +1 −1 lib/conversion_observer/collector.rb
  2. +6 −1 spec/collector_spec.rb
@@ -6,7 +6,7 @@ class Collector
attr_reader :stream
def prepare
- @stream = FSEvents::Stream.watch("#{ENV['HOME']}/Music/to convert", &self.class.stream_callback)
+ @stream = FSEvents::Stream.watch("#{ENV['HOME']}/Music/to convert", :mode => :cache, &self.class.stream_callback)
end
class << self
@@ -21,7 +21,12 @@
end
it 'should create a stream for the music conversion directory' do
- FSEvents::Stream.expects(:watch).with("#{ENV['HOME']}/Music/to convert")
+ FSEvents::Stream.expects(:watch).with("#{ENV['HOME']}/Music/to convert", anything)
+ @collector.prepare
+ end
+
+ it 'should create a stream using the cache mode' do
+ FSEvents::Stream.expects(:watch).with(anything, has_entry(:mode => :cache))
@collector.prepare
end

0 comments on commit 3c75f61

Please sign in to comment.