aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/envutil.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/envutil.rb')
-rw-r--r--test/ruby/envutil.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index f0c4636981..b170c46c83 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -224,6 +224,14 @@ module Test
def assert_is_minus_zero(f)
assert(1.0/f == -Float::INFINITY, "#{f} is not -0.0")
end
+
+ def assert_file(predicate, path)
+ assert(File.__send__(predicate, path), "Expected file #{path.inspect} to be #{predicate}")
+ end
+
+ def assert_file_not(predicate, path)
+ assert(!File.__send__(predicate, path), "Expected file #{path.inspect} not to be #{predicate}")
+ end
end
end
end