diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-09 14:18:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-09 14:18:05 +0000 |
commit | 428ec4ec05c0f5a0c24dacee406854fff623dca4 (patch) | |
tree | 302eabe363f9211c5ba809c9132700b6eba8ceef /test/ruby/envutil.rb | |
parent | e3efce6df1aa691e17c59f442b35b4fd129d3a13 (diff) | |
download | ruby-428ec4ec05c0f5a0c24dacee406854fff623dca4.tar.gz |
envutil.rb: assert_file and assert_file_not
* test/ruby/envutil.rb (assert_file, assert_file_not): more
descriptive assertions for File predicates.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/envutil.rb')
-rw-r--r-- | test/ruby/envutil.rb | 8 |
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 |