summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-30 15:26:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-30 15:26:34 +0000
commit11caac16638cce5b5346e80246045897c33b0732 (patch)
treee7725721798a961007388c48828421ea97fa3665 /test/testunit
parentb36b3067f0ed837e787753604e248085abde433c (diff)
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
assertion message must be String or Proc. suggested by caleb clausen at [ruby-core:29884]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/test_assertion.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/testunit/test_assertion.rb b/test/testunit/test_assertion.rb
new file mode 100644
index 0000000..374d6e0
--- /dev/null
+++ b/test/testunit/test_assertion.rb
@@ -0,0 +1,8 @@
+require 'test/unit'
+class TestAssertion < Test::Unit::TestCase
+ def test_wrong_assertion
+ error, line = assert_raise(ArgumentError) {assert(true, true)}, __LINE__
+ assert_match(/assertion message must be String or Proc, but TrueClass was given/, error.message)
+ assert_match(/\A#{Regexp.quote(__FILE__)}:#{line}:/, error.backtrace[0])
+ end
+end