diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-25 10:41:16 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-25 10:41:16 +0000 |
commit | e87fb88be844f0fae736768846954b6f6f7dc7c3 (patch) | |
tree | cbe2ab069e40b5b7f3217ce95b793426b303a305 /spec/ruby/core/complex/denominator_spec.rb | |
parent | e59bf54b3a88d0465cca021afae7dc05b6db57a7 (diff) | |
download | ruby-e87fb88be844f0fae736768846954b6f6f7dc7c3.tar.gz |
Update to ruby/spec@241f9e7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/complex/denominator_spec.rb')
-rw-r--r-- | spec/ruby/core/complex/denominator_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/core/complex/denominator_spec.rb b/spec/ruby/core/complex/denominator_spec.rb index 511f0d2b72..c1a2003820 100644 --- a/spec/ruby/core/complex/denominator_spec.rb +++ b/spec/ruby/core/complex/denominator_spec.rb @@ -1,5 +1,13 @@ -require_relative '../../shared/complex/denominator' +require_relative '../../spec_helper' describe "Complex#denominator" do - it_behaves_like :complex_denominator, :denominator + it "returns the least common multiple denominator of the real and imaginary parts" do + Complex(3, 4).denominator.should == 1 + Complex(3, bignum_value).denominator.should == 1 + + Complex(3, Rational(3,4)).denominator.should == 4 + + Complex(Rational(4,8), Rational(3,4)).denominator.should == 4 + Complex(Rational(3,8), Rational(3,4)).denominator.should == 8 + end end |