require 'test/unit' require 'facet/nil/[]' require 'facet/nil/empty?' require 'facet/nil/include?' require 'facet/nil/length' require 'facet/nil/to_f' require 'facet/nil/to_h' class TC_NilClass < Test::Unit::TestCase # [] def test_brackets assert_equal( nil, nil[] ) assert_equal( nil, nil[1] ) assert_equal( nil, nil[1,2,3] ) end # empty? def test_empty? assert( nil.empty? ) end def test_blank? assert( nil.blank? ) end # include? def test_include? assert_equal( nil, nil.include? ) end # length def test_length assert_equal( 0, nil.length ) end # to_f def test_to_f assert_equal( 0.0, nil.to_f ) end # to_h def test_to_h assert_equal( {}, nil.to_h ) end end