diff options
Diffstat (limited to 'spec/rubyspec/core/rational/zero_spec.rb')
-rw-r--r-- | spec/rubyspec/core/rational/zero_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/rubyspec/core/rational/zero_spec.rb b/spec/rubyspec/core/rational/zero_spec.rb new file mode 100644 index 0000000000..e6dd751922 --- /dev/null +++ b/spec/rubyspec/core/rational/zero_spec.rb @@ -0,0 +1,13 @@ +describe "Rational#zero?" do + it "returns true if the numerator is 0" do + Rational(0,26).zero?.should be_true + end + + it "returns true if the numerator is 0.0" do + Rational(0.0,26).zero?.should be_true + end + + it "returns false if the numerator isn't 0" do + Rational(26).zero?.should be_false + end +end |