Skip to content

Commit

Permalink
Restrict a few failing tests to run on the right Ruby versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
eventualbuddha committed Dec 24, 2013
1 parent d1ba52f commit 3832d70
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
12 changes: 7 additions & 5 deletions spec/fakefs/fakefs_bug_ruby_2.1.0-preview2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
c.include(FakeFS::SpecHelpers, :fakefs => true)
end

describe 'Find.find', :fakefs => true do
it 'does not give an ArgumentError' do
FileUtils.mkdir_p('/tmp/foo')
found = Find.find('/tmp').to_a
expect(found).to eq(%w(/tmp /tmp/foo))
if RUBY_VERSION >= '2.1'
describe 'Find.find', :fakefs => true do
it 'does not give an ArgumentError' do
FileUtils.mkdir_p('/tmp/foo')
found = Find.find('/tmp').to_a
expect(found).to eq(%w(/tmp /tmp/foo))
end
end
end
22 changes: 12 additions & 10 deletions test/fakefs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -572,20 +572,22 @@ def test_raises_error_on_mtime_if_file_does_not_exist
end
end

def test_can_set_mtime_on_new_file_touch_with_param
time = Time.new(2002, 10, 31, 2, 2, 2, "+02:00")
FileUtils.touch("foo.txt", :mtime => time)
if RUBY_VERSION >= "1.9"
def test_can_set_mtime_on_new_file_touch_with_param
time = Time.new(2002, 10, 31, 2, 2, 2, "+02:00")
FileUtils.touch("foo.txt", :mtime => time)

assert_equal File.mtime("foo.txt"), time
end
assert_equal File.mtime("foo.txt"), time
end

def test_can_set_mtime_on_existing_file_touch_with_param
FileUtils.touch("foo.txt")
def test_can_set_mtime_on_existing_file_touch_with_param
FileUtils.touch("foo.txt")

time = Time.new(2002, 10, 31, 2, 2, 2, "+02:00")
FileUtils.touch("foo.txt", :mtime => time)
time = Time.new(2002, 10, 31, 2, 2, 2, "+02:00")
FileUtils.touch("foo.txt", :mtime => time)

assert_equal File.mtime("foo.txt"), time
assert_equal File.mtime("foo.txt"), time
end
end

def test_can_return_mtime_on_existing_file
Expand Down

0 comments on commit 3832d70

Please sign in to comment.