Permalink
Browse files

Restrict a few failing tests to run on the right Ruby versions.

  • Loading branch information...
1 parent d1ba52f commit 3832d704481dbb43360516ac51db0832123a923a @eventualbuddha eventualbuddha committed Dec 24, 2013
Showing with 19 additions and 15 deletions.
  1. +7 −5 spec/fakefs/fakefs_bug_ruby_2.1.0-preview2_spec.rb
  2. +12 −10 test/fakefs_test.rb
@@ -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
View
@@ -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

0 comments on commit 3832d70

Please sign in to comment.