[test-unit-users-en:00002] Question about assert_kind_of

Daniel Berger djberg96 at gmail.com
Tue May 26 16:16:41 EDT 2009


Hi,

Ruby 1.8.6 p368
test-unit 2.0.2

Why does this fail?

require 'rubygems'
gem 'test-unit'
require 'test/unit'

module Foo
   class BarError < StandardError; end
end

class TC_Test < Test::Unit::TestCase
   def test_class
      assert_kind_of(StandardError, Foo::BarError)
   end
end

Result:


  1) Failure:
test_class(TC_Test) [test_test.rb:11]:
<Foo::BarError>
expected to be kind_of?
<StandardError> but was
<Class>.

Regards,

Dan


More information about the test-unit-users-en mailing list