From 9d049cc72941e7b3f07e5ab8a3e2ed587efacebe Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 16 Dec 2008 13:16:13 +0000 Subject: [PATCH] * lib/minitest/unit.rb (MiniTest::Assertions#assert_instance_of): should assert by instance_of?, not ===. [ruby-dev:37458] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/minitest/unit.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 44412b1b60..c8212712d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 16 22:15:17 2008 Yukihiro Matsumoto + + * lib/minitest/unit.rb (MiniTest::Assertions#assert_instance_of): + should assert by instance_of?, not ===. [ruby-dev:37458] + Tue Dec 16 21:59:29 2008 NAKAMURA Usaku * lib/test/unit.rb (Test::Unit.setup_argv): ALT_SEPARATOR support. diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb index 77176240c5..25cb65c54f 100644 --- a/lib/minitest/unit.rb +++ b/lib/minitest/unit.rb @@ -104,7 +104,7 @@ module MiniTest msg = message(msg) { "Expected #{mu_pp(obj)} to be an instance of #{cls}, not #{obj.class}" } flip = (Module === obj) && ! (Module === cls) # HACK for specs obj, cls = cls, obj if flip - assert cls === obj, msg + assert obj.instance_of?(obj), msg end def assert_kind_of cls, obj, msg = nil # TODO: merge with instance_of