mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@ac878ad
This commit is contained in:
parent
f0bfa266d7
commit
f02d2f82bf
17 changed files with 214 additions and 3 deletions
|
@ -17,6 +17,11 @@ describe :rational_coerce, shared: true do
|
|||
result.last.is_a?(Rational).should be_true
|
||||
end
|
||||
|
||||
it "coerces to Rational, when given a Complex" do
|
||||
Rational(3, 4).coerce(Complex(5)).should == [Rational(5, 1), Rational(3, 4)]
|
||||
Rational(12, 4).coerce(Complex(5, 1)).should == [Complex(5, 1), Complex(3)]
|
||||
end
|
||||
|
||||
it "returns [argument, self] when given a Rational" do
|
||||
Rational(3, 7).coerce(Rational(9, 2)).should == [Rational(9, 2), Rational(3, 7)]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue