summaryrefslogtreecommitdiff
path: root/spec/ruby/core/rational/zero_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/rational/zero_spec.rb')
-rw-r--r--spec/ruby/core/rational/zero_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/rational/zero_spec.rb b/spec/ruby/core/rational/zero_spec.rb
new file mode 100644
index 0000000000..e6dd751922
--- /dev/null
+++ b/spec/ruby/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