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.8.7
- 1.9.2 - 1.9.2
- ree - ree
- jruby
- rbx
branches: branches:
only: only:
- master - master

View File

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