summaryrefslogtreecommitdiff
path: root/spec/ruby/core/complex
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/complex')
-rw-r--r--spec/ruby/core/complex/abs2_spec.rb2
-rw-r--r--spec/ruby/core/complex/abs_spec.rb2
-rw-r--r--spec/ruby/core/complex/angle_spec.rb2
-rw-r--r--spec/ruby/core/complex/arg_spec.rb2
-rw-r--r--spec/ruby/core/complex/coerce_spec.rb2
-rw-r--r--spec/ruby/core/complex/conj_spec.rb2
-rw-r--r--spec/ruby/core/complex/conjugate_spec.rb2
-rw-r--r--spec/ruby/core/complex/denominator_spec.rb2
-rw-r--r--spec/ruby/core/complex/hash_spec.rb14
-rw-r--r--spec/ruby/core/complex/imag_spec.rb2
-rw-r--r--spec/ruby/core/complex/inspect_spec.rb2
-rw-r--r--spec/ruby/core/complex/magnitude_spec.rb2
-rw-r--r--spec/ruby/core/complex/numerator_spec.rb2
-rw-r--r--spec/ruby/core/complex/polar_spec.rb4
-rw-r--r--spec/ruby/core/complex/real_spec.rb2
-rw-r--r--spec/ruby/core/complex/rect_spec.rb4
-rw-r--r--spec/ruby/core/complex/rectangular_spec.rb4
-rw-r--r--spec/ruby/core/complex/to_s_spec.rb2
18 files changed, 32 insertions, 22 deletions
diff --git a/spec/ruby/core/complex/abs2_spec.rb b/spec/ruby/core/complex/abs2_spec.rb
index debfade075..f2145dcb61 100644
--- a/spec/ruby/core/complex/abs2_spec.rb
+++ b/spec/ruby/core/complex/abs2_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/abs2', __FILE__)
describe "Complex#abs2" do
- it_behaves_like(:complex_abs2, :abs2)
+ it_behaves_like :complex_abs2, :abs2
end
diff --git a/spec/ruby/core/complex/abs_spec.rb b/spec/ruby/core/complex/abs_spec.rb
index a00d161ee9..9252c22263 100644
--- a/spec/ruby/core/complex/abs_spec.rb
+++ b/spec/ruby/core/complex/abs_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/abs', __FILE__)
describe "Complex#abs" do
- it_behaves_like(:complex_abs, :abs)
+ it_behaves_like :complex_abs, :abs
end
diff --git a/spec/ruby/core/complex/angle_spec.rb b/spec/ruby/core/complex/angle_spec.rb
index f0c46bfd03..d5f80fe529 100644
--- a/spec/ruby/core/complex/angle_spec.rb
+++ b/spec/ruby/core/complex/angle_spec.rb
@@ -3,5 +3,5 @@ require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../../shared/complex/arg', __FILE__)
describe "Complex#angle" do
- it_behaves_like(:complex_arg, :angle)
+ it_behaves_like :complex_arg, :angle
end
diff --git a/spec/ruby/core/complex/arg_spec.rb b/spec/ruby/core/complex/arg_spec.rb
index 48f8a94cf5..92f5d79ba8 100644
--- a/spec/ruby/core/complex/arg_spec.rb
+++ b/spec/ruby/core/complex/arg_spec.rb
@@ -3,5 +3,5 @@ require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../../shared/complex/arg', __FILE__)
describe "Complex#arg" do
- it_behaves_like(:complex_arg, :arg)
+ it_behaves_like :complex_arg, :arg
end
diff --git a/spec/ruby/core/complex/coerce_spec.rb b/spec/ruby/core/complex/coerce_spec.rb
index 7c01170fde..308da64356 100644
--- a/spec/ruby/core/complex/coerce_spec.rb
+++ b/spec/ruby/core/complex/coerce_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/coerce', __FILE__)
describe "Complex#coerce" do
- it_behaves_like(:complex_coerce, :coerce)
+ it_behaves_like :complex_coerce, :coerce
end
diff --git a/spec/ruby/core/complex/conj_spec.rb b/spec/ruby/core/complex/conj_spec.rb
index ad2c885b3b..fec4516755 100644
--- a/spec/ruby/core/complex/conj_spec.rb
+++ b/spec/ruby/core/complex/conj_spec.rb
@@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../../shared/complex/conjugate', __FILE__)
describe "Complex#conj" do
- it_behaves_like(:complex_conjugate, :conj)
+ it_behaves_like :complex_conjugate, :conj
end
diff --git a/spec/ruby/core/complex/conjugate_spec.rb b/spec/ruby/core/complex/conjugate_spec.rb
index 7fc2ddb430..e5a01bfe45 100644
--- a/spec/ruby/core/complex/conjugate_spec.rb
+++ b/spec/ruby/core/complex/conjugate_spec.rb
@@ -2,5 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../../../shared/complex/conjugate', __FILE__)
describe "Complex#conjugate" do
- it_behaves_like(:complex_conjugate, :conjugate)
+ it_behaves_like :complex_conjugate, :conjugate
end
diff --git a/spec/ruby/core/complex/denominator_spec.rb b/spec/ruby/core/complex/denominator_spec.rb
index 2568967968..7b541910ec 100644
--- a/spec/ruby/core/complex/denominator_spec.rb
+++ b/spec/ruby/core/complex/denominator_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/denominator', __FILE__)
describe "Complex#denominator" do
- it_behaves_like(:complex_denominator, :denominator)
+ it_behaves_like :complex_denominator, :denominator
end
diff --git a/spec/ruby/core/complex/hash_spec.rb b/spec/ruby/core/complex/hash_spec.rb
index db4b3590df..8cdee8b6ab 100644
--- a/spec/ruby/core/complex/hash_spec.rb
+++ b/spec/ruby/core/complex/hash_spec.rb
@@ -1,6 +1,16 @@
require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../../shared/complex/hash', __FILE__)
describe "Complex#hash" do
- it_behaves_like(:complex_hash, :hash)
+ it "is static" do
+ Complex(1).hash.should == Complex(1).hash
+ Complex(1, 0).hash.should == Complex(1).hash
+ Complex(1, 1).hash.should == Complex(1, 1).hash
+ end
+
+ it "is different for different instances" do
+ Complex(1, 2).hash.should_not == Complex(1, 1).hash
+ Complex(2, 1).hash.should_not == Complex(1, 1).hash
+
+ Complex(1, 2).hash.should_not == Complex(2, 1).hash
+ end
end
diff --git a/spec/ruby/core/complex/imag_spec.rb b/spec/ruby/core/complex/imag_spec.rb
index 6aa8803f5d..aa2e24a0d0 100644
--- a/spec/ruby/core/complex/imag_spec.rb
+++ b/spec/ruby/core/complex/imag_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/image', __FILE__)
describe "Complex#imag" do
- it_behaves_like(:complex_image, :imag)
+ it_behaves_like :complex_image, :imag
end
diff --git a/spec/ruby/core/complex/inspect_spec.rb b/spec/ruby/core/complex/inspect_spec.rb
index b766e7f730..96be2ddb6f 100644
--- a/spec/ruby/core/complex/inspect_spec.rb
+++ b/spec/ruby/core/complex/inspect_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/inspect', __FILE__)
describe "Complex#inspect" do
- it_behaves_like(:complex_inspect, :inspect)
+ it_behaves_like :complex_inspect, :inspect
end
diff --git a/spec/ruby/core/complex/magnitude_spec.rb b/spec/ruby/core/complex/magnitude_spec.rb
index e9175d763e..d2c5eb80dd 100644
--- a/spec/ruby/core/complex/magnitude_spec.rb
+++ b/spec/ruby/core/complex/magnitude_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/abs', __FILE__)
describe "Complex#magnitude" do
- it_behaves_like(:complex_abs, :magnitude)
+ it_behaves_like :complex_abs, :magnitude
end
diff --git a/spec/ruby/core/complex/numerator_spec.rb b/spec/ruby/core/complex/numerator_spec.rb
index 8c0e8761bd..322c950a43 100644
--- a/spec/ruby/core/complex/numerator_spec.rb
+++ b/spec/ruby/core/complex/numerator_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/numerator', __FILE__)
describe "Complex#numerator" do
- it_behaves_like(:complex_numerator, :numerator)
+ it_behaves_like :complex_numerator, :numerator
end
diff --git a/spec/ruby/core/complex/polar_spec.rb b/spec/ruby/core/complex/polar_spec.rb
index d847e916ff..110efbbfba 100644
--- a/spec/ruby/core/complex/polar_spec.rb
+++ b/spec/ruby/core/complex/polar_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path('../../../shared/complex/polar', __FILE__)
describe "Complex.polar" do
- it_behaves_like(:complex_polar_class, :polar)
+ it_behaves_like :complex_polar_class, :polar
it "raises a TypeError when given non real arguments" do
lambda{ Complex.polar(nil) }.should raise_error(TypeError)
@@ -10,5 +10,5 @@ describe "Complex.polar" do
end
describe "Complex#polar" do
- it_behaves_like(:complex_polar, :polar)
+ it_behaves_like :complex_polar, :polar
end
diff --git a/spec/ruby/core/complex/real_spec.rb b/spec/ruby/core/complex/real_spec.rb
index 1293e02d3c..a663be117f 100644
--- a/spec/ruby/core/complex/real_spec.rb
+++ b/spec/ruby/core/complex/real_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path('../../../shared/complex/real', __FILE__)
describe "Complex#real" do
- it_behaves_like(:complex_real, :real)
+ it_behaves_like :complex_real, :real
end
describe "Complex#real?" do
diff --git a/spec/ruby/core/complex/rect_spec.rb b/spec/ruby/core/complex/rect_spec.rb
index cf2ff9e83b..b2faa4ec70 100644
--- a/spec/ruby/core/complex/rect_spec.rb
+++ b/spec/ruby/core/complex/rect_spec.rb
@@ -1,9 +1,9 @@
require File.expand_path('../../../shared/complex/rect', __FILE__)
describe "Complex#rect" do
- it_behaves_like(:complex_rect, :rect)
+ it_behaves_like :complex_rect, :rect
end
describe "Complex.rect" do
- it_behaves_like(:complex_rect_class, :rect)
+ it_behaves_like :complex_rect_class, :rect
end
diff --git a/spec/ruby/core/complex/rectangular_spec.rb b/spec/ruby/core/complex/rectangular_spec.rb
index 0eb29c3500..39f78ad518 100644
--- a/spec/ruby/core/complex/rectangular_spec.rb
+++ b/spec/ruby/core/complex/rectangular_spec.rb
@@ -1,9 +1,9 @@
require File.expand_path('../../../shared/complex/rect', __FILE__)
describe "Complex#rectangular" do
- it_behaves_like(:complex_rect, :rectangular)
+ it_behaves_like :complex_rect, :rectangular
end
describe "Complex.rectangular" do
- it_behaves_like(:complex_rect_class, :rectangular)
+ it_behaves_like :complex_rect_class, :rectangular
end
diff --git a/spec/ruby/core/complex/to_s_spec.rb b/spec/ruby/core/complex/to_s_spec.rb
index c398bb000e..d6debe6317 100644
--- a/spec/ruby/core/complex/to_s_spec.rb
+++ b/spec/ruby/core/complex/to_s_spec.rb
@@ -1,5 +1,5 @@
require File.expand_path('../../../shared/complex/to_s', __FILE__)
describe "Complex#to_s" do
- it_behaves_like(:complex_to_s, :to_s)
+ it_behaves_like :complex_to_s, :to_s
end