aboutsummaryrefslogtreecommitdiffstats
path: root/test/fileutils/test_fileutils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fileutils/test_fileutils.rb')
-rw-r--r--test/fileutils/test_fileutils.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 68d503dac4..59658923d9 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -1117,7 +1117,29 @@ class TestFileUtils
uptodate? 'tmp/a', ['tmp/b', Pathname.new('tmp/c')]
uptodate? Pathname.new('tmp/a'), [Pathname.new('tmp/b'), Pathname.new('tmp/c')]
}
+ # [Bug #6708] [ruby-core:46256]
+ assert_raises_with_message(ArgumentError, "wrong number of arguments (3 for 2)") {
+ uptodate?('new',['old', 'oldest'], {})
+ }
+ end
+
+ def assert_raises_with_message(klass, message)
+ begin
+ yield
+ flunk("Expected Exception #{klass} didn't raise")
+ rescue klass => ex
+ if message.kind_of? String
+ flag = !!(ex.message == message)
+ assert(flag, "Expected Exception(#{klass}) was raised, but the message doesn't match")
+ elsif message.kind_of? Regexp
+ flag = !!(ex.message =~ message)
+ assert(flag, "Expected Exception(#{klass}) was raised, but the message doesn't match")
+ else
+ raise
+ end
+ end
end
+ private :assert_raises_with_message
def test_cd
check_singleton :cd