summaryrefslogtreecommitdiff
path: root/spec/ruby/core/nil/to_f_spec.rb
blob: d4890cd42bf8413af8c493c96b97d9c661a579d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
require File.expand_path('../../../spec_helper', __FILE__)

describe "NilClass#to_f" do
  it "returns 0.0" do
    nil.to_f.should == 0.0
  end

  it "does not cause NilClass to be coerced to Float" do
    (0.0 == nil).should == false
  end
end