1 2 3 4 5 6 7 8 9 10 11
require 'abstract_unit' require 'active_support/whiny_nil' class WhinyNilTest < Test::Unit::TestCase def test_id nil.id rescue RuntimeError => nme assert_no_match(/nil:NilClass/, nme.message) assert_match(Regexp.new(nil.object_id.to_s), nme.message) end end