source: EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-object-ext/test/nil.rb@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 289 bytes
Line 
1assert('NilClass#to_a') do
2 assert_equal [], nil.to_a
3end
4
5assert('NilClass#to_f') do
6 skip unless Object.const_defined?(:Float)
7 assert_equal 0.0, nil.to_f
8end
9
10assert('NilClass#to_h') do
11 assert_equal Hash.new, nil.to_h
12end
13
14assert('NilClass#to_i') do
15 assert_equal 0, nil.to_i
16end
Note: See TracBrowser for help on using the repository browser.