Skip to content

Commit

Permalink
Better small_time_difference usage
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudgg committed Apr 3, 2013
1 parent b0bd774 commit 20056c5
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions spec/listen/directory_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
touch 'existing_file.txt'

modified, added, removed = changes(path) do
sleep 1.5 # make a difference in the mtime of the file
small_time_difference
touch 'existing_file.txt'
end

Expand All @@ -417,7 +417,7 @@
touch 'existing_file.txt'

modified, added, removed = changes(path) do
sleep 0.5 # make sure the mtime is changed a bit
small_time_difference
touch 'existing_file.txt'
end

Expand Down Expand Up @@ -452,9 +452,9 @@
changes(path) do
touch 'existing_file.txt'
end
small_time_difference

changes(path) do
small_time_difference
touch 'existing_file.txt'
end

Expand All @@ -476,9 +476,9 @@
changes(path) do
touch 'existing_file.txt'
end
small_time_difference

changes(path, :use_last_record => true) do
small_time_difference
open('existing_file.txt', 'w') { |f| f.write('foo') }
end

Expand All @@ -495,9 +495,9 @@
it "adds the path in the paths checksums if just touched - #62" do
fixtures do |path|
touch 'existing_file.txt'
small_time_difference

changes(path) do
small_time_difference
touch 'existing_file.txt'
end

Expand Down Expand Up @@ -541,9 +541,9 @@
it 'does not detect the mode change' do
fixtures do |path|
touch 'run.rb'
sleep 1.5 # make a difference in the mtime of the file

modified, added, removed = changes(path) do
small_time_difference
chmod 0777, 'run.rb'
end

Expand Down Expand Up @@ -970,9 +970,8 @@
touch 'a_directory/a_file.rb'
touch 'a_directory/b_file.rb'

small_time_difference

modified, added, removed = changes(path) do
small_time_difference
touch 'b_file.rb'
touch 'a_directory/a_file.rb'
end
Expand Down Expand Up @@ -1121,7 +1120,7 @@
chmod 000, 'unreadable_file.txt'

modified, added, removed = changes(path) do
sleep 1.5
small_time_difference
touch 'unreadable_file.txt'
end

Expand Down

0 comments on commit 20056c5

Please sign in to comment.