Skip to content

Commit

Permalink
FSEvents::Stream#startup.
Browse files Browse the repository at this point in the history
To start up a stream, the stream should be scheduled and started (taken from the example of 'taming the autotest beast with FSEvents').
  • Loading branch information
ymendel committed Jun 12, 2008
1 parent f242e38 commit a12b52a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/fsevents/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def start
OSX.FSEventStreamStart(stream)
end

def startup
schedule
start
end

def stop
OSX.FSEventStreamStop(stream)
end
Expand Down
21 changes: 21 additions & 0 deletions spec/stream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,27 @@
@stream.shutdown
end
end

it 'should start up' do
@stream.should respond_to(:startup)
end

describe 'when starting up' do
before :each do
@stream.stubs(:schedule)
@stream.stubs(:start)
end

it 'should schedule' do
@stream.expects(:schedule)
@stream.startup
end

it 'should start' do
@stream.expects(:start)
@stream.startup
end
end
end

describe FSEvents::Stream::StreamError do
Expand Down

0 comments on commit a12b52a

Please sign in to comment.