diff options
Diffstat (limited to 'spec/ruby/core/complex/conjugate_spec.rb')
| -rw-r--r-- | spec/ruby/core/complex/conjugate_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/ruby/core/complex/conjugate_spec.rb b/spec/ruby/core/complex/conjugate_spec.rb index 7fc2ddb430..256fe4b3be 100644 --- a/spec/ruby/core/complex/conjugate_spec.rb +++ b/spec/ruby/core/complex/conjugate_spec.rb @@ -1,6 +1,10 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../../../shared/complex/conjugate', __FILE__) +require_relative '../../spec_helper' describe "Complex#conjugate" do - it_behaves_like(:complex_conjugate, :conjugate) + it "returns the complex conjugate: conj a + bi = a - bi" do + Complex(3, 5).conjugate.should == Complex(3, -5) + Complex(3, -5).conjugate.should == Complex(3, 5) + Complex(-3.0, 5.2).conjugate.should be_close(Complex(-3.0, -5.2), TOLERANCE) + Complex(3.0, -5.2).conjugate.should be_close(Complex(3.0, 5.2), TOLERANCE) + end end |
