[macruby-changes] [1968] MacRuby/branches/experimental/spec/frozen
source_changes at macosforge.org
source_changes at macosforge.org
Wed Jul 1 16:53:26 PDT 2009
Revision: 1968
http://trac.macosforge.org/projects/ruby/changeset/1968
Author: eloy.de.enige at gmail.com
Date: 2009-07-01 16:53:26 -0700 (Wed, 01 Jul 2009)
Log Message:
-----------
Updated RubySpec to 8a452e68e5b045a20ce1964fa997f9d691316b1c
Modified Paths:
--------------
MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb
MacRuby/branches/experimental/spec/frozen/core/dir/shared/exists.rb
MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb
MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb
MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb
MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb
MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/abs.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/abs2.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/arg.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/coerce.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/conjugate.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/divide.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/equal_value.rb
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/float/comparison_tags.txt
MacRuby/branches/experimental/spec/frozen/upstream
Added Paths:
-----------
MacRuby/branches/experimental/spec/frozen/core/complex/modulo_spec.rb
MacRuby/branches/experimental/spec/frozen/core/complex/multiply_spec.rb
MacRuby/branches/experimental/spec/frozen/core/complex/numerator_spec.rb
MacRuby/branches/experimental/spec/frozen/core/complex/plus_spec.rb
MacRuby/branches/experimental/spec/frozen/core/complex/polar_spec.rb
MacRuby/branches/experimental/spec/frozen/core/complex/real_spec.rb
MacRuby/branches/experimental/spec/frozen/core/complex/to_s_spec.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/modulo.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/multiply.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/numerator.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/plus.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/polar.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/real.rb
MacRuby/branches/experimental/spec/frozen/shared/complex/to_s.rb
MacRuby/branches/experimental/spec/frozen/tags/1.9/core/complex/modulo_tags.txt
Modified: MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/core/bignum/comparison_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -37,7 +37,7 @@
end
it "returns 1 when self is negative and other is -Infinity" do
- (-Float::MAX.to_i*2 <=> @inf).should == 1
+ (-Float::MAX.to_i*2 <=> - at inf).should == 1
end
it "returns -1 when self is -Infinity and other is negative" do
Added: MacRuby/branches/experimental/spec/frozen/core/complex/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/complex/modulo_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/complex/modulo_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../../shared/complex/modulo'
+
+ruby_version_is "1.9" do
+ describe "Complex#% with Complex" do
+ it_behaves_like(:complex_modulo_complex, :%)
+ end
+
+ describe "Complex#% with Integer" do
+ it_behaves_like(:complex_modulo_integer, :%)
+ end
+
+ describe "Complex#% with Object" do
+ it_behaves_like(:complex_modulo_object, :%)
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/core/complex/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/complex/multiply_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/complex/multiply_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../shared/complex/multiply'
+
+ruby_version_is "1.9" do
+
+ describe "Complex#* with Complex" do
+ it_behaves_like(:complex_multiply_complex, :*)
+ end
+
+ describe "Complex#* with Integer" do
+ it_behaves_like(:complex_multiply_integer, :*)
+ end
+
+ describe "Complex#* with Object" do
+ it_behaves_like(:complex_multiply_object, :*)
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/core/complex/numerator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/complex/numerator_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/complex/numerator_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../../shared/complex/numerator'
+
+ruby_version_is "1.9" do
+ describe "Complex#numerator" do
+ it_behaves_like(:complex_numerator, :numerator)
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/core/complex/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/complex/plus_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/complex/plus_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + '/../../shared/complex/plus'
+
+ruby_version_is "1.9" do
+
+ describe "Complex#+ with Complex" do
+ it_behaves_like(:complex_plus_complex, :+)
+ end
+
+ describe "Complex#+ with Integer" do
+ it_behaves_like(:complex_plus_integer, :+)
+ end
+
+ describe "Complex#+ with Object" do
+ it_behaves_like(:complex_plus_object, :+)
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/core/complex/polar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/complex/polar_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/complex/polar_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../shared/complex/polar'
+
+ruby_version_is "1.9" do
+
+ describe "Complex.polar" do
+ it_behaves_like(:complex_polar, :polar)
+ end
+
+ describe "Complex#polar" do
+ it_behaves_like(:complex_polar, :polar)
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/core/complex/real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/complex/real_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/complex/real_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../../shared/complex/real'
+
+ruby_version_is "1.9" do
+
+ describe "Complex#real" do
+ it_behaves_like(:complex_real, :real)
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/core/complex/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/complex/to_s_spec.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/complex/to_s_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../shared/complex/to_s'
+
+ruby_version_is "1.9" do
+
+ describe "Complex#to_s when self's real component is 0" do
+ it_behaves_like(:complex_to_s_0, :to_s)
+ end
+
+ describe "Complex#to_s" do
+ it_behaves_like(:complex_to_s, :to_s)
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/core/dir/shared/exists.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/dir/shared/exists.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/core/dir/shared/exists.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -33,9 +33,9 @@
Dir.send(@method, dir).should be_true
end
- it "expands paths" do
+ it "doesn't expand paths" do
Dir.send(@method, File.expand_path('~')).should be_true
- Dir.send(@method, '~').should be_true
+ Dir.send(@method, '~').should be_false
end
it "returns false if the argument exists but is a file" do
Modified: MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/core/float/comparison_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -25,16 +25,16 @@
(@inf <=> Float::MAX.to_i*2).should == 1
end
- it "returns 1 when self is negative and other is Infinty" do
- (-Float::MAX.to_i*2 <=> @inf).should == 1
+ it "returns -1 when self is negative and other is Infinty" do
+ (-Float::MAX.to_i*2 <=> @inf).should == -1
end
it "returns -1 when self is -Infinity and other is negative" do
(- at inf <=> -Float::MAX.to_i*2).should == -1
end
- it "returns -1 when self is negative and other is -Infinity" do
- (- at inf <=> -Float::MAX.to_i*2).should == -1
+ it "returns 1 when self is negative and other is -Infinity" do
+ (-Float::MAX.to_i*2 <=> - at inf).should == 1
end
end
@@ -45,16 +45,16 @@
(@inf <=> Float::MAX.to_i*2).should == 1
end
- it "returns 1 when self is negative and other is Infinty" do
- (-Float::MAX.to_i*2 <=> @inf).should == 1
+ it "returns -1 when self is negative and other is Infinty" do
+ (-Float::MAX.to_i*2 <=> @inf).should == -1
end
it "returns -1 when self is -Infinity and other is negative" do
(- at inf <=> -Float::MAX.to_i*2).should == -1
end
- it "returns -1 when self is negative and other is -Infinity" do
- (- at inf <=> -Float::MAX.to_i*2).should == -1
+ it "returns 1 when self is negative and other is -Infinity" do
+ (-Float::MAX.to_i*2 <=> - at inf).should == 1
end
end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/Complex_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,53 +1,57 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-describe "Complex when passed [Complex, Complex]" do
- it "returns a new Complex number based on the two given numbers" do
- Complex(Complex(3, 4), Complex(5, 6)).should == Complex.new(3 - 6, 4 + 5)
- Complex(Complex(1.5, 2), Complex(-5, 6.3)).should == Complex.new(1.5 - 6.3, 2 - 5)
- end
-end
+ruby_version_is ""..."1.9" do
-describe "Complex when passed [Complex]" do
- it "returns the passed Complex number" do
- Complex(Complex(1, 2)).should == Complex(1, 2)
- Complex(Complex(-3.4, bignum_value)).should == Complex(-3.4, bignum_value)
+ require 'complex'
+
+ describe "Complex when passed [Complex, Complex]" do
+ it "returns a new Complex number based on the two given numbers" do
+ Complex(Complex(3, 4), Complex(5, 6)).should == Complex.new(3 - 6, 4 + 5)
+ Complex(Complex(1.5, 2), Complex(-5, 6.3)).should == Complex.new(1.5 - 6.3, 2 - 5)
+ end
end
-end
-describe "Complex when passed [Integer, Integer]" do
- it "returns a new Complex number" do
- Complex(1, 2).should == Complex.new(1, 2)
- Complex(-3, -5).should == Complex.new(-3, -5)
- Complex(3.5, -4.5).should == Complex.new(3.5, -4.5)
- Complex(bignum_value, 30).should == Complex.new(bignum_value, 30)
+ describe "Complex when passed [Complex]" do
+ it "returns the passed Complex number" do
+ Complex(Complex(1, 2)).should == Complex(1, 2)
+ Complex(Complex(-3.4, bignum_value)).should == Complex(-3.4, bignum_value)
+ end
end
-end
-describe "Complex when passed [Integer]" do
- it "returns a new Complex number with 0 as the imaginary component" do
- # Guard against the Mathn library
- conflicts_with :Prime do
- Complex(1).should eql(Complex.new(1, 0))
- Complex(-3).should eql(Complex.new(-3, 0))
- Complex(-4.5).should eql(Complex.new(-4.5, 0))
- Complex(bignum_value).should eql(Complex.new(bignum_value, 0))
+ describe "Complex when passed [Integer, Integer]" do
+ it "returns a new Complex number" do
+ Complex(1, 2).should == Complex.new(1, 2)
+ Complex(-3, -5).should == Complex.new(-3, -5)
+ Complex(3.5, -4.5).should == Complex.new(3.5, -4.5)
+ Complex(bignum_value, 30).should == Complex.new(bignum_value, 30)
end
end
-
- it "returns the passed Integer when Complex::Unify is defined" do
- # Guard against the Mathn library
- conflicts_with :Prime do
- begin
- Complex::Unify = true
-
- Complex(1).should eql(1)
- Complex(-3).should eql(-3)
- Complex(-4.5).should eql(-4.5)
- Complex(bignum_value).should eql(bignum_value)
- ensure
- Complex.send :remove_const, :Unify
+
+ describe "Complex when passed [Integer]" do
+ it "returns a new Complex number with 0 as the imaginary component" do
+ # Guard against the Mathn library
+ conflicts_with :Prime do
+ Complex(1).should eql(Complex.new(1, 0))
+ Complex(-3).should eql(Complex.new(-3, 0))
+ Complex(-4.5).should eql(Complex.new(-4.5, 0))
+ Complex(bignum_value).should eql(Complex.new(bignum_value, 0))
end
end
+
+ it "returns the passed Integer when Complex::Unify is defined" do
+ # Guard against the Mathn library
+ conflicts_with :Prime do
+ begin
+ Complex::Unify = true
+
+ Complex(1).should eql(1)
+ Complex(-3).should eql(-3)
+ Complex(-4.5).should eql(-4.5)
+ Complex(bignum_value).should eql(bignum_value)
+ ensure
+ Complex.send :remove_const, :Unify
+ end
+ end
+ end
end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/abs2_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,9 @@
require File.dirname(__FILE__) + '/../../shared/complex/abs2'
-require 'complex'
ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
describe "Complex#abs2" do
it_behaves_like(:complex_abs2, :abs2)
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/abs_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,9 @@
require File.dirname(__FILE__) + '/../../shared/complex/abs'
-require 'complex'
ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
describe "Complex#abs" do
it_behaves_like(:complex_abs, :abs)
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/coerce_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,8 +1,10 @@
require File.dirname(__FILE__) + '/../../shared/complex/coerce'
-require 'complex'
-require "rational"
ruby_version_is ""..."1.9" do
+
+ require 'complex'
+ require "rational"
+
describe "Complex#coerce" do
it_behaves_like(:complex_coerce, :coerce)
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/comparison_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,9 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
describe "Complex#<=>" do
it "compares the absolute values of self and other" do
(Complex(1, 2) <=> Complex(2, 1)).should == 0
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/denominator_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,17 +1,19 @@
require File.dirname(__FILE__) + '/../../shared/complex/denominator'
-require 'complex'
-# FIXME:
-# Complex#denominator requires the rational library,
-# as Integer#denominator is defined by it.
-# I think this method is pretty buggy, as there is no
-# denominator for Floats and rational might not always
-# be loaded, both resulting in a method missing exception.
-# Also, the documentation for Complex#denominator does
-# not mention a dependency for rational.
-require "rational"
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
-ruby_version_is ""..."1.9" do
+ # FIXME:
+ # Complex#denominator requires the rational library,
+ # as Integer#denominator is defined by it.
+ # I think this method is pretty buggy, as there is no
+ # denominator for Floats and rational might not always
+ # be loaded, both resulting in a method missing exception.
+ # Also, the documentation for Complex#denominator does
+ # not mention a dependency for rational.
+ require "rational"
+
describe "Complex#denominator" do
it_behaves_like(:complex_denominator, :denominator)
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/divide_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,9 @@
require File.dirname(__FILE__) + '/../../shared/complex/divide'
-require 'complex'
ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
describe "Complex#/ with Complex" do
it_behaves_like(:complex_divide_complex, :/)
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/equal_value_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,9 @@
require File.dirname(__FILE__) + '/../../shared/complex/equal_value'
-require 'complex'
ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
describe "Complex#== with Complex" do
it_behaves_like(:complex_equal_value_complex, :shared => true)
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/exponent_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,8 +1,10 @@
require File.dirname(__FILE__) + '/../../shared/complex/exponent'
-require "complex"
-require "rational"
ruby_version_is ""..."1.9" do
+
+ require "complex"
+ require "rational"
+
describe "Complex#** when given 0" do
it_behaves_like(:complex_exponent_zero, :**)
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/generic_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,23 +1,27 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-require "rational"
-describe "Complex.generic?" do
- it "returns true when given an Integer, Float or Rational" do
- Complex.generic?(1).should == true
- Complex.generic?(-1).should == true
+ruby_version_is ""..."1.9" do
- Complex.generic?(20.3).should == true
- Complex.generic?(-20.3).should == true
+ require 'complex'
+ require "rational"
- Complex.generic?(bignum_value).should == true
- Complex.generic?(-bignum_value).should == true
+ describe "Complex.generic?" do
+ it "returns true when given an Integer, Float or Rational" do
+ Complex.generic?(1).should == true
+ Complex.generic?(-1).should == true
- Complex.generic?(Rational(3, 4)).should == true
- Complex.generic?(-Rational(3, 4)).should == true
-
- Complex.generic?(:symbol).should == false
- Complex.generic?("string").should == false
- Complex.generic?(mock("Object")).should == false
+ Complex.generic?(20.3).should == true
+ Complex.generic?(-20.3).should == true
+
+ Complex.generic?(bignum_value).should == true
+ Complex.generic?(-bignum_value).should == true
+
+ Complex.generic?(Rational(3, 4)).should == true
+ Complex.generic?(-Rational(3, 4)).should == true
+
+ Complex.generic?(:symbol).should == false
+ Complex.generic?("string").should == false
+ Complex.generic?(mock("Object")).should == false
+ end
end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/hash_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,17 +1,21 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-describe "Complex#hash" do
- # NOTE:
- # Complex(2, 1).hash == Complex(1, 2).hash
- # This can result in Bugs when using hash and
- # other stuff that relies on #hash
- it "should be 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
-
- Complex(1, 2).hash.should_not == Complex(1, 1).hash
- Complex(2, 1).hash.should_not == Complex(1, 1).hash
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Complex#hash" do
+ # NOTE:
+ # Complex(2, 1).hash == Complex(1, 2).hash
+ # This can result in Bugs when using hash and
+ # other stuff that relies on #hash
+ it "should be 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
+
+ Complex(1, 2).hash.should_not == Complex(1, 1).hash
+ Complex(2, 1).hash.should_not == Complex(1, 1).hash
+ end
end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/imag_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,10 @@
require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/shared/image'
-require 'complex'
-describe "Complex#imag" do
- it_behaves_like(:complex_image, :imag)
+ruby_version_is ""..."1.9" do
+ require 'complex'
+
+ describe "Complex#imag" do
+ it_behaves_like(:complex_image, :imag)
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/image_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,11 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/shared/image'
-require 'complex'
-describe "Complex#image" do
- it_behaves_like(:complex_image, :image)
-end
\ No newline at end of file
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+ require File.dirname(__FILE__) + '/shared/image'
+
+ describe "Complex#image" do
+ it_behaves_like(:complex_image, :image)
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/inspect_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,15 +1,19 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-describe "Complex#inspect" do
- it %{returns "Complex(real, image)"} do
- # Guard against the Mathn library
- conflicts_with :Prime do
- Complex(1).inspect.should == "Complex(1, 0)"
- Complex(7).inspect.should == "Complex(7, 0)"
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Complex#inspect" do
+ it %{returns "Complex(real, image)"} do
+ # Guard against the Mathn library
+ conflicts_with :Prime do
+ Complex(1).inspect.should == "Complex(1, 0)"
+ Complex(7).inspect.should == "Complex(7, 0)"
+ end
+
+ Complex(-1, 4).inspect.should == "Complex(-1, 4)"
+ Complex(-7, 6.7).inspect.should == "Complex(-7, 6.7)"
end
-
- Complex(-1, 4).inspect.should == "Complex(-1, 4)"
- Complex(-7, 6.7).inspect.should == "Complex(-7, 6.7)"
end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/acos_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,29 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/acos'
-describe "Math#acos" do
- it_behaves_like :complex_math_acos, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
- it "should be private" do
- IncludesMath.should have_private_instance_method(:acos)
+ describe "Math#acos" do
+ it_behaves_like :complex_math_acos, :_, IncludesMath.new
+
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:acos)
+ end
end
-end
-describe "Math#acos!" do
- it_behaves_like :complex_math_acos_bang, :_, IncludesMath.new
+ describe "Math#acos!" do
+ it_behaves_like :complex_math_acos_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:acos!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:acos!)
+ end
end
-end
-describe "Math.acos" do
- it_behaves_like :complex_math_acos, :_, Math
-end
+ describe "Math.acos" do
+ it_behaves_like :complex_math_acos, :_, Math
+ end
-describe "Math.acos!" do
- it_behaves_like :complex_math_acos_bang, :_, Math
+ describe "Math.acos!" do
+ it_behaves_like :complex_math_acos_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/acosh_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/acosh'
-describe "Math#acosh" do
- it_behaves_like :complex_math_acosh, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#acosh" do
+ it_behaves_like :complex_math_acosh, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:acosh)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:acosh)
+ end
end
-end
-describe "Math#acosh!" do
- it_behaves_like :complex_math_acosh_bang, :_, IncludesMath.new
+ describe "Math#acosh!" do
+ it_behaves_like :complex_math_acosh_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:acosh!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:acosh!)
+ end
end
-end
-describe "Math.acosh" do
- it_behaves_like :complex_math_acosh, :_, Math
-end
+ describe "Math.acosh" do
+ it_behaves_like :complex_math_acosh, :_, Math
+ end
-describe "Math.acosh!" do
- it_behaves_like :complex_math_acosh_bang, :_, Math
+ describe "Math.acosh!" do
+ it_behaves_like :complex_math_acosh_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/asin_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/asin'
-describe "Math#asin" do
- it_behaves_like :complex_math_asin, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#asin" do
+ it_behaves_like :complex_math_asin, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:asin)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:asin)
+ end
end
-end
-describe "Math#asin!" do
- it_behaves_like :complex_math_asin_bang, :_, IncludesMath.new
+ describe "Math#asin!" do
+ it_behaves_like :complex_math_asin_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:asin!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:asin!)
+ end
end
-end
-describe "Math.asin" do
- it_behaves_like :complex_math_asin, :_, Math
-end
+ describe "Math.asin" do
+ it_behaves_like :complex_math_asin, :_, Math
+ end
-describe "Math.asin!" do
- it_behaves_like :complex_math_asin_bang, :_, Math
+ describe "Math.asin!" do
+ it_behaves_like :complex_math_asin_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/asinh_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/asinh'
-describe "Math#asinh" do
- it_behaves_like :complex_math_asinh, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#asinh" do
+ it_behaves_like :complex_math_asinh, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:asinh)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:asinh)
+ end
end
-end
-describe "Math#asinh!" do
- it_behaves_like :complex_math_asinh_bang, :_, IncludesMath.new
+ describe "Math#asinh!" do
+ it_behaves_like :complex_math_asinh_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:asinh!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:asinh!)
+ end
end
-end
-describe "Math.asinh" do
- it_behaves_like :complex_math_asinh, :_, Math
-end
+ describe "Math.asinh" do
+ it_behaves_like :complex_math_asinh, :_, Math
+ end
-describe "Math.asinh!" do
- it_behaves_like :complex_math_asinh_bang, :_, Math
+ describe "Math.asinh!" do
+ it_behaves_like :complex_math_asinh_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/atan2_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/atan2'
-describe "Math#atan2" do
- it_behaves_like :complex_math_atan2, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#atan2" do
+ it_behaves_like :complex_math_atan2, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:atan2)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:atan2)
+ end
end
-end
-describe "Math#atan2!" do
- it_behaves_like :complex_math_atan2_bang, :_, IncludesMath.new
+ describe "Math#atan2!" do
+ it_behaves_like :complex_math_atan2_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:atan2!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:atan2!)
+ end
end
-end
-describe "Math.atan2" do
- it_behaves_like :complex_math_atan2, :_, Math
-end
+ describe "Math.atan2" do
+ it_behaves_like :complex_math_atan2, :_, Math
+ end
-describe "Math.atan2!" do
- it_behaves_like :complex_math_atan2_bang, :_, Math
+ describe "Math.atan2!" do
+ it_behaves_like :complex_math_atan2_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/atan_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/atan'
-describe "Math#atan" do
- it_behaves_like :complex_math_atan, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#atan" do
+ it_behaves_like :complex_math_atan, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:atan)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:atan)
+ end
end
-end
-describe "Math#atan!" do
- it_behaves_like :complex_math_atan_bang, :_, IncludesMath.new
+ describe "Math#atan!" do
+ it_behaves_like :complex_math_atan_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:atan!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:atan!)
+ end
end
-end
-describe "Math.atan" do
- it_behaves_like :complex_math_atan, :_, Math
-end
+ describe "Math.atan" do
+ it_behaves_like :complex_math_atan, :_, Math
+ end
-describe "Math.atan!" do
- it_behaves_like :complex_math_atan_bang, :_, Math
+ describe "Math.atan!" do
+ it_behaves_like :complex_math_atan_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/atanh_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/atanh'
-describe "Math#atanh" do
- it_behaves_like :complex_math_atanh, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#atanh" do
+ it_behaves_like :complex_math_atanh, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:atanh)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:atanh)
+ end
end
-end
-describe "Math#atanh!" do
- it_behaves_like :complex_math_atanh_bang, :_, IncludesMath.new
+ describe "Math#atanh!" do
+ it_behaves_like :complex_math_atanh_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:atanh!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:atanh!)
+ end
end
-end
-describe "Math.atanh" do
- it_behaves_like :complex_math_atanh, :_, Math
-end
+ describe "Math.atanh" do
+ it_behaves_like :complex_math_atanh, :_, Math
+ end
-describe "Math.atanh!" do
- it_behaves_like :complex_math_atanh_bang, :_, Math
+ describe "Math.atanh!" do
+ it_behaves_like :complex_math_atanh_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/cos_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/cos'
-describe "Math#cos" do
- it_behaves_like :complex_math_cos, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#cos" do
+ it_behaves_like :complex_math_cos, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:cos)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:cos)
+ end
end
-end
-describe "Math#cos!" do
- it_behaves_like :complex_math_cos_bang, :_, IncludesMath.new
+ describe "Math#cos!" do
+ it_behaves_like :complex_math_cos_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:cos!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:cos!)
+ end
end
-end
-describe "Math.cos" do
- it_behaves_like :complex_math_cos, :_, Math
-end
+ describe "Math.cos" do
+ it_behaves_like :complex_math_cos, :_, Math
+ end
-describe "Math.cos!" do
- it_behaves_like :complex_math_cos_bang, :_, Math
+ describe "Math.cos!" do
+ it_behaves_like :complex_math_cos_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/cosh_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/cosh'
-describe "Math#cosh" do
- it_behaves_like :complex_math_cosh, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#cosh" do
+ it_behaves_like :complex_math_cosh, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:cosh)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:cosh)
+ end
end
-end
-describe "Math#cosh!" do
- it_behaves_like :complex_math_cosh_bang, :_, IncludesMath.new
+ describe "Math#cosh!" do
+ it_behaves_like :complex_math_cosh_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:cosh!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:cosh!)
+ end
end
-end
-describe "Math.cosh" do
- it_behaves_like :complex_math_cosh, :_, Math
-end
+ describe "Math.cosh" do
+ it_behaves_like :complex_math_cosh, :_, Math
+ end
-describe "Math.cosh!" do
- it_behaves_like :complex_math_cosh_bang, :_, Math
+ describe "Math.cosh!" do
+ it_behaves_like :complex_math_cosh_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/exp_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/exp'
-describe "Math#exp" do
- it_behaves_like :complex_math_exp, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#exp" do
+ it_behaves_like :complex_math_exp, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:exp)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:exp)
+ end
end
-end
-describe "Math#exp!" do
- it_behaves_like :complex_math_exp_bang, :_, IncludesMath.new
+ describe "Math#exp!" do
+ it_behaves_like :complex_math_exp_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:exp!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:exp!)
+ end
end
-end
-describe "Math.exp" do
- it_behaves_like :complex_math_exp, :_, Math
-end
+ describe "Math.exp" do
+ it_behaves_like :complex_math_exp, :_, Math
+ end
-describe "Math.exp!" do
- it_behaves_like :complex_math_exp_bang, :_, Math
+ describe "Math.exp!" do
+ it_behaves_like :complex_math_exp_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/log10_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/log10'
-describe "Math#log10" do
- it_behaves_like :complex_math_log10, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#log10" do
+ it_behaves_like :complex_math_log10, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:log10)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:log10)
+ end
end
-end
-describe "Math#log10!" do
- it_behaves_like :complex_math_log10_bang, :_, IncludesMath.new
+ describe "Math#log10!" do
+ it_behaves_like :complex_math_log10_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:log10!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:log10!)
+ end
end
-end
-describe "Math.log10" do
- it_behaves_like :complex_math_log10, :_, Math
-end
+ describe "Math.log10" do
+ it_behaves_like :complex_math_log10, :_, Math
+ end
-describe "Math.log10!" do
- it_behaves_like :complex_math_log10_bang, :_, Math
+ describe "Math.log10!" do
+ it_behaves_like :complex_math_log10_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/log_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/log'
-describe "Math#log" do
- it_behaves_like :complex_math_log, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#log" do
+ it_behaves_like :complex_math_log, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:log)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:log)
+ end
end
-end
-describe "Math#log!" do
- it_behaves_like :complex_math_log_bang, :_, IncludesMath.new
+ describe "Math#log!" do
+ it_behaves_like :complex_math_log_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:log!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:log!)
+ end
end
-end
-describe "Math.log" do
- it_behaves_like :complex_math_log, :_, Math
-end
+ describe "Math.log" do
+ it_behaves_like :complex_math_log, :_, Math
+ end
-describe "Math.log!" do
- it_behaves_like :complex_math_log_bang, :_, Math
+ describe "Math.log!" do
+ it_behaves_like :complex_math_log_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acos.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_acos, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/acosh.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_acosh, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asin.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_asin, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/asinh.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_asinh, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_atan, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atan2.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_atan2, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/atanh.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_atanh, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cos.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_cos, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/cosh.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_cosh, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/exp.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_exp, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_log, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/log10.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_log10, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sin.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_sin, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sinh.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_sinh, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/sqrt.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_sqrt, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tan.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_tan, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/shared/tanh.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,3 @@
-require 'complex'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe :complex_math_tanh, :shared => true do
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/sin_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/sin'
-describe "Math#sin" do
- it_behaves_like :complex_math_sin, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#sin" do
+ it_behaves_like :complex_math_sin, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:sin)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:sin)
+ end
end
-end
-describe "Math#sin!" do
- it_behaves_like :complex_math_sin_bang, :_, IncludesMath.new
+ describe "Math#sin!" do
+ it_behaves_like :complex_math_sin_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:sin!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:sin!)
+ end
end
-end
-describe "Math.sin" do
- it_behaves_like :complex_math_sin, :_, Math
-end
+ describe "Math.sin" do
+ it_behaves_like :complex_math_sin, :_, Math
+ end
-describe "Math.sin!" do
- it_behaves_like :complex_math_sin_bang, :_, Math
+ describe "Math.sin!" do
+ it_behaves_like :complex_math_sin_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/sinh_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/sinh'
-describe "Math#sinh" do
- it_behaves_like :complex_math_sinh, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#sinh" do
+ it_behaves_like :complex_math_sinh, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:sinh)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:sinh)
+ end
end
-end
-describe "Math#sinh!" do
- it_behaves_like :complex_math_sinh_bang, :_, IncludesMath.new
+ describe "Math#sinh!" do
+ it_behaves_like :complex_math_sinh_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:sinh!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:sinh!)
+ end
end
-end
-describe "Math.sinh" do
- it_behaves_like :complex_math_sinh, :_, Math
-end
+ describe "Math.sinh" do
+ it_behaves_like :complex_math_sinh, :_, Math
+ end
-describe "Math.sinh!" do
- it_behaves_like :complex_math_sinh_bang, :_, Math
+ describe "Math.sinh!" do
+ it_behaves_like :complex_math_sinh_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/sqrt_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/sqrt'
-describe "Math#sqrt" do
- it_behaves_like :complex_math_sqrt, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#sqrt" do
+ it_behaves_like :complex_math_sqrt, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:sqrt)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:sqrt)
+ end
end
-end
-describe "Math#sqrt!" do
- it_behaves_like :complex_math_sqrt_bang, :_, IncludesMath.new
+ describe "Math#sqrt!" do
+ it_behaves_like :complex_math_sqrt_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:sqrt!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:sqrt!)
+ end
end
-end
-describe "Math.sqrt" do
- it_behaves_like :complex_math_sqrt, :_, Math
-end
+ describe "Math.sqrt" do
+ it_behaves_like :complex_math_sqrt, :_, Math
+ end
-describe "Math.sqrt!" do
- it_behaves_like :complex_math_sqrt_bang, :_, Math
+ describe "Math.sqrt!" do
+ it_behaves_like :complex_math_sqrt_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/tan_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/tan'
-describe "Math#tan" do
- it_behaves_like :complex_math_tan, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#tan" do
+ it_behaves_like :complex_math_tan, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:tan)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:tan)
+ end
end
-end
-describe "Math#tan!" do
- it_behaves_like :complex_math_tan_bang, :_, IncludesMath.new
+ describe "Math#tan!" do
+ it_behaves_like :complex_math_tan_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:tan!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:tan!)
+ end
end
-end
-describe "Math.tan" do
- it_behaves_like :complex_math_tan, :_, Math
-end
+ describe "Math.tan" do
+ it_behaves_like :complex_math_tan, :_, Math
+ end
-describe "Math.tan!" do
- it_behaves_like :complex_math_tan_bang, :_, Math
+ describe "Math.tan!" do
+ it_behaves_like :complex_math_tan_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/math/tanh_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,28 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/tanh'
-describe "Math#tanh" do
- it_behaves_like :complex_math_tanh, :_, IncludesMath.new
+ruby_version_is ""..."1.9" do
+ describe "Math#tanh" do
+ it_behaves_like :complex_math_tanh, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:tanh)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:tanh)
+ end
end
-end
-describe "Math#tanh!" do
- it_behaves_like :complex_math_tanh_bang, :_, IncludesMath.new
+ describe "Math#tanh!" do
+ it_behaves_like :complex_math_tanh_bang, :_, IncludesMath.new
- it "should be private" do
- IncludesMath.should have_private_instance_method(:tanh!)
+ it "should be private" do
+ IncludesMath.should have_private_instance_method(:tanh!)
+ end
end
-end
-describe "Math.tanh" do
- it_behaves_like :complex_math_tanh, :_, Math
-end
+ describe "Math.tanh" do
+ it_behaves_like :complex_math_tanh, :_, Math
+ end
-describe "Math.tanh!" do
- it_behaves_like :complex_math_tanh_bang, :_, Math
+ describe "Math.tanh!" do
+ it_behaves_like :complex_math_tanh_bang, :_, Math
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/minus_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,30 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-describe "Complex#- with Complex" do
- it "subtracts both the real and imaginary components" do
- (Complex(1, 2) - Complex(10, 20)).should == Complex(1 - 10, 2 - 20)
- (Complex(1.5, 2.1) - Complex(100.2, -30.3)).should == Complex(1.5 - 100.2, 2.1 - (-30.3))
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Complex#- with Complex" do
+ it "subtracts both the real and imaginary components" do
+ (Complex(1, 2) - Complex(10, 20)).should == Complex(1 - 10, 2 - 20)
+ (Complex(1.5, 2.1) - Complex(100.2, -30.3)).should == Complex(1.5 - 100.2, 2.1 - (-30.3))
+ end
end
-end
-describe "Complex#- with Integer" do
- it "subtracts the real number from the real component of self" do
- (Complex(1, 2) - 50).should == Complex(-49, 2)
- (Complex(1, 2) - 50.5).should == Complex(-49.5, 2)
+ describe "Complex#- with Integer" do
+ it "subtracts the real number from the real component of self" do
+ (Complex(1, 2) - 50).should == Complex(-49, 2)
+ (Complex(1, 2) - 50.5).should == Complex(-49.5, 2)
+ end
end
-end
-describe "Complex#- with Object" do
- it "tries to coerce self into other" do
- value = Complex(3, 9)
-
- obj = mock("Object")
- obj.should_receive(:coerce).with(value).and_return([2, 5])
- (value - obj).should == 2 - 5
+ describe "Complex#- with Object" do
+ it "tries to coerce self into other" do
+ value = Complex(3, 9)
+
+ obj = mock("Object")
+ obj.should_receive(:coerce).with(value).and_return([2, 5])
+ (value - obj).should == 2 - 5
+ end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,18 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
+require File.dirname(__FILE__) + '/../../shared/complex/modulo'
-describe "Complex#% with Complex" do
- it "returns the remainder from complex division" do
- (Complex(13, 44) % Complex(5, 20)).should == Complex(13 % 5, 44 % 20)
- (Complex(13.5, 44.5) % Complex(5.5, 20.5)).should == Complex(13.5 % 5.5, 44.5 % 20.5)
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Complex#% with Complex" do
+ it_behaves_like(:complex_modulo_complex, :%)
end
-end
-describe "Complex#% with Integer" do
- it "returns the remainder from dividing both parts of self by the given Integer" do
- (Complex(21, 42) % 10).should == Complex(21 % 10, 42 % 10)
- (Complex(15.5, 16.5) % 2.0).should be_close(Complex(15.5 % 2, 16.5 % 2), TOLERANCE)
+ describe "Complex#% with Integer" do
+ it_behaves_like(:complex_modulo_integer, :%)
end
-end
-describe "Complex#% with Object" do
- it "tries to coerce self into other" do
- value = Complex(3, 9)
-
- obj = mock("Object")
- obj.should_receive(:coerce).with(value).and_return([2, 5])
- (value % obj).should == 2 % 5
+ describe "Complex#% with Object" do
+ it_behaves_like(:complex_modulo_object, :%)
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,18 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
+require File.dirname(__FILE__) + '/../../shared/complex/multiply'
-describe "Complex#* with Complex" do
- it "multiplies according to the usual rule for complex numbers: (a + bi) * (c + di) = ac - bd + (ad + bc)i" do
- (Complex(1, 2) * Complex(10, 20)).should == Complex((1 * 10) - (2 * 20), (1 * 20) + (2 * 10))
- (Complex(1.5, 2.1) * Complex(100.2, -30.3)).should == Complex((1.5 * 100.2) - (2.1 * -30.3), (1.5 * -30.3) + (2.1 * 100.2))
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Complex#* with Complex" do
+ it_behaves_like(:complex_multiply_complex, :*)
end
-end
-describe "Complex#* with Integer" do
- it "multiplies both parts of self by the given Integer" do
- (Complex(3, 2) * 50).should == Complex(150, 100)
- (Complex(-3, 2) * 50.5).should == Complex(-151.5, 101)
+ describe "Complex#* with Integer" do
+ it_behaves_like(:complex_multiply_integer, :*)
end
-end
-describe "Complex#* with Object" do
- it "tries to coerce self into other" do
- value = Complex(3, 9)
-
- obj = mock("Object")
- obj.should_receive(:coerce).with(value).and_return([2, 5])
- (value * obj).should == 2 * 5
+ describe "Complex#* with Object" do
+ it_behaves_like(:complex_multiply_object, :*)
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/new_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,39 +1,43 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-describe "Complex.new" do
- it "returns a new Complex number" do
- Complex.new(1, 2).class.should == Complex
- end
-
- it "raises a TypeError when one of the given arguments is not Numeric" do
- lambda { Complex.new(1, "foo") }.should raise_error(TypeError)
- lambda { Complex.new("bar", 2) }.should raise_error(TypeError)
- end
+ruby_version_is ""..."1.9" do
- it "raises a TypeError when one of the given arguments is a Complex" do
- lambda { Complex.new(Complex(1), "foo") }.should raise_error(TypeError)
- lambda { Complex.new("bar", Complex(3, 5)) }.should raise_error(TypeError)
- end
-end
+ require 'complex'
-describe "Complex.new!" do
- it "returns a new Complex number" do
- Complex.new(1, 2).class.should == Complex
+ describe "Complex.new" do
+ it "returns a new Complex number" do
+ Complex.new(1, 2).class.should == Complex
+ end
+
+ it "raises a TypeError when one of the given arguments is not Numeric" do
+ lambda { Complex.new(1, "foo") }.should raise_error(TypeError)
+ lambda { Complex.new("bar", 2) }.should raise_error(TypeError)
+ end
+
+ it "raises a TypeError when one of the given arguments is a Complex" do
+ lambda { Complex.new(Complex(1), "foo") }.should raise_error(TypeError)
+ lambda { Complex.new("bar", Complex(3, 5)) }.should raise_error(TypeError)
+ end
end
-
- it "defaults to 0 for the imaginery part" do
- a = Complex.new!(3)
- a.image.should == 0
- end
-
- it "raises a TypeError when one of the given arguments is not Numeric" do
- lambda { Complex.new(1, "foo") }.should raise_error(TypeError)
- lambda { Complex.new("bar", 2) }.should raise_error(TypeError)
- end
- it "raises a TypeError when one of the given arguments is a Complex" do
- lambda { Complex.new(Complex(1), "foo") }.should raise_error(TypeError)
- lambda { Complex.new("bar", Complex(3, 5)) }.should raise_error(TypeError)
+ describe "Complex.new!" do
+ it "returns a new Complex number" do
+ Complex.new(1, 2).class.should == Complex
+ end
+
+ it "defaults to 0 for the imaginery part" do
+ a = Complex.new!(3)
+ a.image.should == 0
+ end
+
+ it "raises a TypeError when one of the given arguments is not Numeric" do
+ lambda { Complex.new(1, "foo") }.should raise_error(TypeError)
+ lambda { Complex.new("bar", 2) }.should raise_error(TypeError)
+ end
+
+ it "raises a TypeError when one of the given arguments is a Complex" do
+ lambda { Complex.new(Complex(1), "foo") }.should raise_error(TypeError)
+ lambda { Complex.new("bar", Complex(3, 5)) }.should raise_error(TypeError)
+ end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,22 +1,12 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-# Depends on Rational to be loaded.
-require "rational"
+require File.dirname(__FILE__) + '/../../shared/complex/numerator'
-describe "Complex#numerator" do
- it "returns self's numerator" do
- Complex(2).numerator.should == Complex(2)
- Complex(3, 4).numerator.should == Complex(3, 4)
-
- Complex(Rational(3, 4), Rational(3, 4)).numerator.should == Complex(3, 3)
- Complex(Rational(7, 4), Rational(8, 4)).numerator.should == Complex(7, 8)
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+ # Depends on Rational to be loaded.
+ require "rational"
- Complex(Rational(7, 8), Rational(8, 4)).numerator.should == Complex(7, 16)
- Complex(Rational(7, 4), Rational(8, 8)).numerator.should == Complex(7, 4)
-
- # NOTE:
- # Bug? - Fails with a MethodMissingError
- # (undefined method `denominator' for 3.5:Float)
- # Complex(3.5, 3.7).numerator
+ describe "Complex#numerator" do
+ it_behaves_like(:complex_numerator, :numerator)
end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/angle_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,11 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/arg'
-require 'complex'
-describe "Numeric#angle" do
- it_behaves_like :numeric_arg, :angle
-end
\ No newline at end of file
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#angle" do
+ it_behaves_like :numeric_arg, :angle
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/arg_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,11 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/arg'
-require 'complex'
-describe "Numeric#arg" do
- it_behaves_like :numeric_arg, :arg
-end
\ No newline at end of file
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#arg" do
+ it_behaves_like :numeric_arg, :arg
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conj_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,11 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/conjugate'
-require 'complex'
-describe "Numeric#conj" do
- it_behaves_like :numeric_conjugate, :conj
-end
\ No newline at end of file
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#conj" do
+ it_behaves_like :numeric_conjugate, :conj
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/conjugate_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,11 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/conjugate'
-require 'complex'
-describe "Numeric#conjugate" do
- it_behaves_like :numeric_conjugate, :conjugate
-end
\ No newline at end of file
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#conjugate" do
+ it_behaves_like :numeric_conjugate, :conjugate
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/im_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,10 +1,14 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
-require 'complex'
-describe "Numeric#im" do
- it "returns a new Complex number with self as the imaginary component" do
- 20.im.should == Complex(0, 20)
- (-4.5).im.should == Complex(0, -4.5)
- bignum_value.im.should == Complex(0, bignum_value)
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#im" do
+ it "returns a new Complex number with self as the imaginary component" do
+ 20.im.should == Complex(0, 20)
+ (-4.5).im.should == Complex(0, -4.5)
+ bignum_value.im.should == Complex(0, bignum_value)
+ end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/imag_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,11 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/image'
-require 'complex'
-describe "Numeric#imag" do
- it_behaves_like :numeric_image, :imag
-end
\ No newline at end of file
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#imag" do
+ it_behaves_like :numeric_image, :imag
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/image_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,7 +1,11 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/shared/image'
-require 'complex'
-describe "Numeric#image" do
- it_behaves_like :numeric_image, :image
-end
\ No newline at end of file
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#image" do
+ it_behaves_like :numeric_image, :image
+ end
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/polar_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,15 +1,19 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
-require 'complex'
-describe "Numeric#polar" do
- it "returns self's absolute value and self's argument" do
- 5.polar.should == [5, 0]
- (-5).polar.should == [5, Math::PI]
-
- 4.5.polar.should == [4.5, 0]
- (-4.5).polar.should == [4.5, Math::PI]
+ruby_version_is ""..."1.9" do
- bignum_value.polar.should == [bignum_value, 0]
- (-bignum_value).polar.should == [bignum_value, Math::PI]
+ require 'complex'
+
+ describe "Numeric#polar" do
+ it "returns self's absolute value and self's argument" do
+ 5.polar.should == [5, 0]
+ (-5).polar.should == [5, Math::PI]
+
+ 4.5.polar.should == [4.5, 0]
+ (-4.5).polar.should == [4.5, Math::PI]
+
+ bignum_value.polar.should == [bignum_value, 0]
+ (-bignum_value).polar.should == [bignum_value, Math::PI]
+ end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/real_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,10 +1,14 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
-require 'complex'
-describe "Numeric#real" do
- it "returns self" do
- 20.real.should == 20
- (-4.5).real.should == -4.5
- bignum_value.real.should == bignum_value
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Numeric#real" do
+ it "returns self" do
+ 20.real.should == 20
+ (-4.5).real.should == -4.5
+ bignum_value.real.should == bignum_value
+ end
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/arg.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,3 @@
-require 'complex'
-
describe :numeric_arg, :shared => true do
it "returns 0 if self is greater than or equal to 0" do
0.send(@method).should == 0
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/conjugate.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,3 @@
-require 'complex'
-
describe :numeric_conjugate, :shared => true do
it "returns self" do
20.send(@method).should == 20
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/numeric/shared/image.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,3 @@
-require 'complex'
-
describe :numeric_image, :shared => true do
it "returns 0" do
20.send(@method).should == 0
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,26 +1,18 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
+require File.dirname(__FILE__) + '/../../shared/complex/plus'
-describe "Complex#+ with Complex" do
- it "adds both the real and imaginary components" do
- (Complex(1, 2) + Complex(10, 20)).should == Complex(1 + 10, 2 + 20)
- (Complex(1.5, 2.1) + Complex(100.2, -30.3)).should == Complex(1.5 + 100.2, 2.1 + (-30.3))
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Complex#+ with Complex" do
+ it_behaves_like(:complex_plus_complex, :+)
end
-end
-describe "Complex#+ with Integer" do
- it "adds the real number to the real component of self" do
- (Complex(1, 2) + 50).should == Complex(51, 2)
- (Complex(1, 2) + 50.5).should == Complex(51.5, 2)
+ describe "Complex#+ with Integer" do
+ it_behaves_like(:complex_plus_integer, :+)
end
-end
-describe "Complex#+ with Object" do
- it "tries to coerce self into other" do
- value = Complex(3, 9)
-
- obj = mock("Object")
- obj.should_receive(:coerce).with(value).and_return([2, 5])
- (value + obj).should == 2 + 5
+ describe "Complex#+ with Object" do
+ it_behaves_like(:complex_plus_object, :+)
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,23 +1,14 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
+require File.dirname(__FILE__) + '/../../shared/complex/polar'
-describe "Complex.polar" do
- it "returns a complex number in terms of radius and angle" do
- Complex.polar(50, 60).should be_close(Complex(-47.6206490207578, -15.2405310551108), TOLERANCE)
- Complex.polar(-10, -20).should be_close(Complex(-4.08082061813392, 9.12945250727628), TOLERANCE)
- end
-end
+ruby_version_is ""..."1.9" do
-describe "Complex#polar" do
- it "returns the absolute value and the argument" do
- a = Complex(3, 4)
- a.polar.size.should == 2
- a.polar.first.should == 5.0
- a.polar.last.should be_close(0.927295218001612, TOLERANCE)
+ require 'complex'
- b = Complex(-3.5, 4.7)
- b.polar.size.should == 2
- b.polar.first.should be_close(5.86003412959345, TOLERANCE)
- b.polar.last.should be_close(2.21088447955664, TOLERANCE)
+ describe "Complex.polar" do
+ it_behaves_like(:complex_polar, :polar)
end
+
+ describe "Complex#polar" do
+ it_behaves_like(:complex_polar, :polar)
+ end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,11 +1,10 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
+require File.dirname(__FILE__) + '/../../shared/complex/real'
-describe "Complex#real" do
- it "returns the real part of self" do
- Complex(1, 0).real.should == 1
- Complex(2, 1).real.should == 2
- Complex(6.7, 8.9).real.should == 6.7
- Complex(bignum_value, 3).real.should == bignum_value
+ruby_version_is ""..."1.9" do
+
+ require 'complex'
+
+ describe "Complex#real" do
+ it_behaves_like(:complex_real, :real)
end
end
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/shared/image.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,3 @@
-require 'complex'
-
describe :complex_image, :shared => true do
it "returns the imaginary part of self" do
Complex(1, 0).send(@method).should == 0
Modified: MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/library/complex/to_s_spec.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,29 +1,14 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
+require File.dirname(__FILE__) + '/../../shared/complex/to_s'
-describe "Complex#to_s when self's real component is 0" do
- it "returns only the imaginary component as String" do
- Complex(0, 5).to_s.should == "5i"
- Complex(0, -3.2).to_s.should == "-3.2i"
- end
-end
+ruby_version_is ""..."1.9" do
-describe "Complex#to_s" do
- it "returns self as String" do
- Complex(1, 5).to_s.should == "1+5i"
- Complex(-2.5, 1.5).to_s.should == "-2.5+1.5i"
-
- Complex(1, -5).to_s.should == "1-5i"
- Complex(-2.5, -1.5).to_s.should == "-2.5-1.5i"
+ require 'complex'
- # Guard against the Mathn library
- conflicts_with :Prime do
- Complex(1, 0).to_s.should == "1+0i"
- Complex(1, -0).to_s.should == "1+0i"
+ describe "Complex#to_s when self's real component is 0" do
+ it_behaves_like(:complex_to_s_0, :to_s)
+ end
- # This is a bit weird, but it's what MRI does
- Complex(1, 0.0).to_s.should == "1+0.0i"
- Complex(1, -0.0).to_s.should == "1+0.0i"
- end
+ describe "Complex#to_s" do
+ it_behaves_like(:complex_to_s, :to_s)
end
-end
\ No newline at end of file
+end
Modified: MacRuby/branches/experimental/spec/frozen/shared/complex/abs.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/abs.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/abs.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,4 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
describe :complex_abs, :shared => true do
it "returns the modulus: |a + bi| = sqrt((a ^ 2) + (b ^ 2))" do
Modified: MacRuby/branches/experimental/spec/frozen/shared/complex/abs2.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/abs2.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/abs2.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,4 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
describe :complex_abs2, :shared => true do
it "returns the sum of the squares of the real and imaginary parts" do
Modified: MacRuby/branches/experimental/spec/frozen/shared/complex/arg.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/arg.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/arg.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,3 @@
-require 'complex'
-
describe :complex_arg, :shared => true do
it "returns the argument -- i.e., the angle from (1, 0) in the complex plane" do
TwoPi = 2 * Math::PI
Modified: MacRuby/branches/experimental/spec/frozen/shared/complex/coerce.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/coerce.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/coerce.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,6 +1,4 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
-require "rational"
describe :complex_coerce, :shared => true do
before(:each) do
Modified: MacRuby/branches/experimental/spec/frozen/shared/complex/conjugate.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/conjugate.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/conjugate.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,3 @@
-require 'complex'
-
describe :complex_conjugate, :shared => true do
it "returns the complex conjugate: conj a + bi = a - bi" do
Complex(3, 5).send(@method).should == Complex(3, -5)
Modified: MacRuby/branches/experimental/spec/frozen/shared/complex/divide.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/divide.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/divide.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,4 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
describe :complex_divide_complex, :shared => true do
it "divides according to the usual rule for complex numbers" do
@@ -46,9 +45,9 @@
end
ruby_version_is "1.9" do
- it "returns (Infinity+Infinity*i) when given zero" do
- (Complex(20, 40) / 0.0).inspect.should == "(Infinity+Infinity*i)"
- (Complex(-20, -40) / 0.0).inspect.should == "(-Infinity-Infinity*i)"
+ it "raises a ZeroDivisionError when given 0.0" do
+ lambda { Complex(20, 40) / 0.0 }.should raise_error(ZeroDivisionError)
+ lambda { Complex(-20, -40) / 0.0 }.should raise_error(ZeroDivisionError)
end
end
end
Modified: MacRuby/branches/experimental/spec/frozen/shared/complex/equal_value.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/equal_value.rb 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/equal_value.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,5 +1,4 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'complex'
describe :complex_equal_value_complex, :shared => true do
it "returns true when self and other have numerical equality" do
Copied: MacRuby/branches/experimental/spec/frozen/shared/complex/modulo.rb (from rev 1967, MacRuby/branches/experimental/spec/frozen/library/complex/modulo_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/modulo.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/modulo.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe :complex_modulo_complex, :shared => true do
+ it "returns the remainder from complex division" do
+ (Complex(13, 44) % Complex(5, 20)).should == Complex(13 % 5, 44 % 20)
+ (Complex(13.5, 44.5) % Complex(5.5, 20.5)).should == Complex(13.5 % 5.5, 44.5 % 20.5)
+ end
+end
+
+describe :complex_modulo_integer, :shared => true do
+ it "returns the remainder from dividing both parts of self by the given Integer" do
+ (Complex(21, 42) % 10).should == Complex(21 % 10, 42 % 10)
+ (Complex(15.5, 16.5) % 2.0).should be_close(Complex(15.5 % 2, 16.5 % 2), TOLERANCE)
+ end
+end
+
+describe :complex_modulo_object, :shared => true do
+ it "tries to coerce self into other" do
+ value = Complex(3, 9)
+
+ obj = mock("Object")
+ obj.should_receive(:coerce).with(value).and_return([2, 5])
+ (value % obj).should == 2 % 5
+ end
+end
Copied: MacRuby/branches/experimental/spec/frozen/shared/complex/multiply.rb (from rev 1967, MacRuby/branches/experimental/spec/frozen/library/complex/multiply_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/multiply.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/multiply.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,24 @@
+
+describe :complex_multiply_complex, :shared => true do
+ it "multiplies according to the usual rule for complex numbers: (a + bi) * (c + di) = ac - bd + (ad + bc)i" do
+ (Complex(1, 2) * Complex(10, 20)).should == Complex((1 * 10) - (2 * 20), (1 * 20) + (2 * 10))
+ (Complex(1.5, 2.1) * Complex(100.2, -30.3)).should == Complex((1.5 * 100.2) - (2.1 * -30.3), (1.5 * -30.3) + (2.1 * 100.2))
+ end
+end
+
+describe :complex_multiply_integer, :shared => true do
+ it "multiplies both parts of self by the given Integer" do
+ (Complex(3, 2) * 50).should == Complex(150, 100)
+ (Complex(-3, 2) * 50.5).should == Complex(-151.5, 101)
+ end
+end
+
+describe :complex_multiply_object, :shared => true do
+ it "tries to coerce self into other" do
+ value = Complex(3, 9)
+
+ obj = mock("Object")
+ obj.should_receive(:coerce).with(value).and_return([2, 5])
+ (value * obj).should == 2 * 5
+ end
+end
Copied: MacRuby/branches/experimental/spec/frozen/shared/complex/numerator.rb (from rev 1967, MacRuby/branches/experimental/spec/frozen/library/complex/numerator_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/numerator.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/numerator.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,19 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe :complex_numerator, :shared => true do
+ it "returns self's numerator" do
+ Complex(2).numerator.should == Complex(2)
+ Complex(3, 4).numerator.should == Complex(3, 4)
+
+ Complex(Rational(3, 4), Rational(3, 4)).numerator.should == Complex(3, 3)
+ Complex(Rational(7, 4), Rational(8, 4)).numerator.should == Complex(7, 8)
+
+ Complex(Rational(7, 8), Rational(8, 4)).numerator.should == Complex(7, 16)
+ Complex(Rational(7, 4), Rational(8, 8)).numerator.should == Complex(7, 4)
+
+ # NOTE:
+ # Bug? - Fails with a MethodMissingError
+ # (undefined method `denominator' for 3.5:Float)
+ # Complex(3.5, 3.7).numerator
+ end
+end
Copied: MacRuby/branches/experimental/spec/frozen/shared/complex/plus.rb (from rev 1967, MacRuby/branches/experimental/spec/frozen/library/complex/plus_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/plus.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/plus.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe :complex_plus_complex, :shared => true do
+ it "adds both the real and imaginary components" do
+ (Complex(1, 2) + Complex(10, 20)).should == Complex(1 + 10, 2 + 20)
+ (Complex(1.5, 2.1) + Complex(100.2, -30.3)).should == Complex(1.5 + 100.2, 2.1 + (-30.3))
+ end
+end
+
+describe :complex_plus_integer, :shared => true do
+ it "adds the real number to the real component of self" do
+ (Complex(1, 2) + 50).should == Complex(51, 2)
+ (Complex(1, 2) + 50.5).should == Complex(51.5, 2)
+ end
+end
+
+describe :complex_plus_object, :shared => true do
+ it "tries to coerce self into other" do
+ value = Complex(3, 9)
+
+ obj = mock("Object")
+ obj.should_receive(:coerce).with(value).and_return([2, 5])
+ (value + obj).should == 2 + 5
+ end
+end
Copied: MacRuby/branches/experimental/spec/frozen/shared/complex/polar.rb (from rev 1967, MacRuby/branches/experimental/spec/frozen/library/complex/polar_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/polar.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/polar.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe :complex_polar_class, :shared => true do
+ it "returns a complex number in terms of radius and angle" do
+ Complex.polar(50, 60).should be_close(Complex(-47.6206490207578, -15.2405310551108), TOLERANCE)
+ Complex.polar(-10, -20).should be_close(Complex(-4.08082061813392, 9.12945250727628), TOLERANCE)
+ end
+end
+
+describe :complex_polar, :shared => true do
+ it "returns the absolute value and the argument" do
+ a = Complex(3, 4)
+ a.polar.size.should == 2
+ a.polar.first.should == 5.0
+ a.polar.last.should be_close(0.927295218001612, TOLERANCE)
+
+ b = Complex(-3.5, 4.7)
+ b.polar.size.should == 2
+ b.polar.first.should be_close(5.86003412959345, TOLERANCE)
+ b.polar.last.should be_close(2.21088447955664, TOLERANCE)
+ end
+end
Copied: MacRuby/branches/experimental/spec/frozen/shared/complex/real.rb (from rev 1967, MacRuby/branches/experimental/spec/frozen/library/complex/real_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/real.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/real.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,8 @@
+describe :complex_real, :shared => true do
+ it "returns the real part of self" do
+ Complex(1, 0).real.should == 1
+ Complex(2, 1).real.should == 2
+ Complex(6.7, 8.9).real.should == 6.7
+ Complex(bignum_value, 3).real.should == bignum_value
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/shared/complex/to_s.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/shared/complex/to_s.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/shared/complex/to_s.rb 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe :complex_to_s_0, :shared => true do
+ ruby_version_is ""..."1.9" do
+ it "returns only the imaginary component as String" do
+ Complex(0, 5).to_s.should == "5i"
+ Complex(0, -3.2).to_s.should == "-3.2i"
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "returns both the real and imaginary component even when the real is 0" do
+ Complex(0, 5).to_s.should == "0+5i"
+ Complex(0, -3.2).to_s.should == "0-3.2i"
+ end
+ end
+end
+
+describe :complex_to_s, :shared => true do
+ it "returns self as String" do
+ Complex(1, 5).to_s.should == "1+5i"
+ Complex(-2.5, 1.5).to_s.should == "-2.5+1.5i"
+
+ Complex(1, -5).to_s.should == "1-5i"
+ Complex(-2.5, -1.5).to_s.should == "-2.5-1.5i"
+
+ # Guard against the Mathn library
+ conflicts_with :Prime do
+ Complex(1, 0).to_s.should == "1+0i"
+ Complex(1, -0).to_s.should == "1+0i"
+
+ ruby_version_is ""..."1.9" do
+ # This is a bit weird, but it's what MRI does
+ Complex(1, 0.0).to_s.should == "1+0.0i"
+ Complex(1, -0.0).to_s.should == "1+0.0i"
+ end
+ end
+ end
+end
Added: MacRuby/branches/experimental/spec/frozen/tags/1.9/core/complex/modulo_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/1.9/core/complex/modulo_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/1.9/core/complex/modulo_tags.txt 2009-07-01 23:53:26 UTC (rev 1968)
@@ -0,0 +1,3 @@
+fails:Complex#% with Complex returns the remainder from complex division
+fails:Complex#% with Integer returns the remainder from dividing both parts of self by the given Integer
+fails:Complex#% with Object tries to coerce self into other
Modified: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/float/comparison_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/float/comparison_tags.txt 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/float/comparison_tags.txt 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1,4 +1,4 @@
fails:Float#<=> returns 1 when self is Infinity and other is a Bignum
-fails:Float#<=> returns 1 when self is negative and other is Infinty
+fails:Float#<=> returns -1 when self is negative and other is Infinty
fails:Float#<=> returns 1 when self is Infinity and other is a Bignum
-fails:Float#<=> returns 1 when self is negative and other is Infinty
+fails:Float#<=> returns -1 when self is negative and other is Infinty
Modified: MacRuby/branches/experimental/spec/frozen/upstream
===================================================================
--- MacRuby/branches/experimental/spec/frozen/upstream 2009-07-01 23:51:15 UTC (rev 1967)
+++ MacRuby/branches/experimental/spec/frozen/upstream 2009-07-01 23:53:26 UTC (rev 1968)
@@ -1 +1 @@
-6f75d0c5ce0edb5437e84f59eda4a9dce4a39a2d
\ No newline at end of file
+8a452e68e5b045a20ce1964fa997f9d691316b1c
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090701/bd1c28e5/attachment-0001.html>
More information about the macruby-changes
mailing list