summaryrefslogtreecommitdiff
path: root/spec/ruby/shared/rational/numerator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/shared/rational/numerator.rb')
-rw-r--r--spec/ruby/shared/rational/numerator.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/shared/rational/numerator.rb b/spec/ruby/shared/rational/numerator.rb
new file mode 100644
index 0000000000..e4868ef43c
--- /dev/null
+++ b/spec/ruby/shared/rational/numerator.rb
@@ -0,0 +1,10 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe :rational_numerator, shared: true do
+ it "returns the numerator" do
+ Rational(3, 4).numerator.should equal(3)
+ Rational(3, -4).numerator.should equal(-3)
+
+ Rational(bignum_value, 1).numerator.should == bignum_value
+ end
+end