/vendor/gems/facets-2.4.5/test/core/kernel/test_val.rb
Ruby | 27 lines | 22 code | 5 blank | 0 comment | 0 complexity | cf9b4fe35089372cb910056e7d412f97 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- require 'facets/kernel/val.rb'
- require 'test/unit'
- class TestKernelVal < Test::Unit::TestCase
- def test_val_1
- f = nil
- t = 1
- assert( ! f.val? )
- assert( t.val? )
- end
- def test_val_2
- f = []
- t = [1]
- assert( ! f.val? )
- assert( t.val? )
- end
- def test_val_3
- f = ''
- t = '1'
- assert( ! f.val? )
- assert( t.val? )
- end
- end