diff options
Diffstat (limited to 'spec/ruby/core/nil/to_i_spec.rb')
-rw-r--r-- | spec/ruby/core/nil/to_i_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/core/nil/to_i_spec.rb b/spec/ruby/core/nil/to_i_spec.rb new file mode 100644 index 0000000000..91282822a8 --- /dev/null +++ b/spec/ruby/core/nil/to_i_spec.rb @@ -0,0 +1,11 @@ +require File.expand_path('../../../spec_helper', __FILE__) + +describe "NilClass#to_i" do + it "returns 0" do + nil.to_i.should == 0 + end + + it "does not cause NilClass to be coerced to Fixnum" do + (0 == nil).should == false + end +end |