Skip to content

Commit

Permalink
Added FSEvents::Stream#run as a way to easily run the stream.
Browse files Browse the repository at this point in the history
This merely calls OSX.CFRunLoopRun, which passes control to the Carbon framework.
  • Loading branch information
ymendel committed Jun 15, 2008
1 parent 167e74b commit 4bc6ed1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/fsevents/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,9 @@ def shutdown
invalidate
release
end

def run
OSX.CFRunLoopRun
end
end
end
11 changes: 11 additions & 0 deletions spec/stream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,17 @@
@stream.shutdown
end
end

it 'should run' do
@stream.should respond_to(:run)
end

describe 'running' do
it 'should enter the run loop' do
OSX.expects(:CFRunLoopRun)
@stream.run
end
end
end

describe FSEvents::Stream::StreamError do
Expand Down

0 comments on commit 4bc6ed1

Please sign in to comment.