Make specs pass on jruby & rubinius (Mac OS X)

This commit is contained in:
Thibaud Guillaume-Gentil 2011-09-03 22:37:36 +02:00
parent ee5468eeeb
commit e1472cb0c4
2 changed files with 10 additions and 9 deletions

View File

@ -2,6 +2,8 @@ rvm:
- 1.8.7
- 1.9.2
- ree
- jruby
- rbx
branches:
only:
- master

View File

@ -1,10 +1,10 @@
private
def start(rest_delay = @rest_delay)
sleep(rest_delay || 1)
def start
sleep(@rest_delay || 1)
@listener.update_last_event
Thread.new { @listener.start }
sleep(rest_delay || 1)
sleep(@rest_delay || 1)
end
def record_results
@ -16,10 +16,10 @@ private
end
end
def stop(rest_delay = @rest_delay)
sleep(rest_delay || 1)
def stop
sleep(@rest_delay || 1)
@listener.stop
sleep(rest_delay || 1)
sleep(@rest_delay || 1)
end
def results
@ -28,7 +28,7 @@ private
shared_examples_for 'a listener that reacts to #on_change' do |rest_delay|
before(:each) do
@rest_delay = rest_delay
@rest_delay = rest_delay if rest_delay.is_a?(Integer) || rest_delay.is_a?(Float) # jruby workaround
@listener = described_class.new
record_results
end
@ -64,7 +64,6 @@ shared_examples_for 'a listener that reacts to #on_change' do |rest_delay|
it "not catches a single file chmod update" do
file = @fixture_path.join("folder1/file1.txt")
File.exists?(file).should be_true
File.chmod(0775, file)
start
File.chmod(0777, file)
stop
@ -118,7 +117,7 @@ end
shared_examples_for "a listener scoped to a specific directory" do |rest_delay|
before :each do
@rest_delay = rest_delay
@rest_delay = rest_delay if rest_delay.is_a?(Integer) || rest_delay.is_a?(Float) # jruby workaround
@wd = @fixture_path.join("folder1")
@listener = described_class.new @wd
end