diff options
Diffstat (limited to 'spec/rubyspec/core/integer/denominator_spec.rb')
-rw-r--r-- | spec/rubyspec/core/integer/denominator_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/rubyspec/core/integer/denominator_spec.rb b/spec/rubyspec/core/integer/denominator_spec.rb new file mode 100644 index 0000000000..6d080ac81f --- /dev/null +++ b/spec/rubyspec/core/integer/denominator_spec.rb @@ -0,0 +1,20 @@ +require File.expand_path('../../../spec_helper', __FILE__) + +describe "Integer#denominator" do + # The Numeric child classes override this method, so their behaviour is + # specified in the appropriate place + before :each do + @numbers = [ + 20, # Integer + -2709, # Negative Integer + 99999999**99, # Bignum + -99999**621, # Negative BigNum + 0, + 1 + ] + end + + it "returns 1" do + @numbers.each {|number| number.denominator.should == 1} + end +end |