must not use touch on Linux

This commit is contained in:
Niklas Hofer 2011-05-13 23:56:39 +02:00
parent bc740d725f
commit 7b95eeb275
2 changed files with 5 additions and 3 deletions

View File

@ -47,6 +47,8 @@ describe Guard::Linux do
it_should_behave_like "a listener that reacts to #on_change"
it_should_behave_like "a listener scoped to a specific directory"
# Fun fact: File.touch seems not to be enough on Linux to trigger a modify event
it "doesn't process a change when it is stopped" do
@listener = described_class.new
record_results

View File

@ -53,7 +53,7 @@ shared_examples_for 'a listener that reacts to #on_change' do
file = @fixture_path.join("folder1/file1.txt")
File.exists?(file).should be_true
start
FileUtils.touch file
File.open(file, 'w') {|f| f.write('') }
stop
results.should =~ ['spec/fixtures/folder1/file1.txt']
end
@ -64,8 +64,8 @@ shared_examples_for 'a listener that reacts to #on_change' do
File.exists?(file1).should be_true
File.exists?(file2).should be_true
start
FileUtils.touch file1
FileUtils.touch file2
File.open(file1, 'w') {|f| f.write('') }
File.open(file2, 'w') {|f| f.write('') }
stop
results.should =~ ['spec/fixtures/folder1/file1.txt', 'spec/fixtures/folder1/folder2/file2.txt']
end