Skip to content

Commit

Permalink
Add Float#<=> spec when argument is not a Float
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosgaldino committed May 12, 2012
1 parent 66ac6d5 commit ddbebd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/ruby/core/float/comparison_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
(1771.176 <=> nan_value).should be_nil
end

it "returns nil when the given argument is not a Float" do
(1.0 <=> "1").should be_nil
end

# TODO: Remove duplicate ruby_bug guards when ruby_bug is fixed.
ruby_bug "[ruby-dev:38672] [Bug #1645]", "1.8.7" do
# The 4 tests below are taken from matz's revision 23730 for Ruby trunk
Expand Down

0 comments on commit ddbebd6

Please sign in to comment.