0
require File.dirname(__FILE__) + '/../../../spec_helper'
0
+require File.dirname(__FILE__) + '/fixtures/classes'
0
+ @im = IncludesMath.new
0
+ it "should be private" do
0
+ IncludesMath.private_instance_methods.should include("cos")
0
+ it "returns the sine of the passed argument expressed in radians" do
0
+ @im.send(:sin, Math::PI).should be_close(0.0, TOLERANCE)
0
+ @im.send(:sin, 0).should be_close(0.0, TOLERANCE)
0
+ @im.send(:sin, Math::PI/2).should be_close(1.0, TOLERANCE)
0
+ @im.send(:sin, 3*Math::PI/2).should be_close(-1.0, TOLERANCE)
0
+ @im.send(:sin, 2*Math::PI).should be_close(0.0, TOLERANCE)
0
+ @im.send(:sin, Complex(0, Math::PI)).should be_close(Complex(0.0, 11.5487393572577), TOLERANCE)
0
+ @im.send(:sin, Complex(3, 4)).should be_close(Complex(3.85373803791938, -27.0168132580039), TOLERANCE)
0
describe "Math#sin!" do
0
- it "needs to be reviewed for spec completeness" do
0
+ @im = IncludesMath.new
0
+ it "should be private" do
0
+ IncludesMath.private_instance_methods.should include("cos!")
0
+ it "returns the sine of the passed argument expressed in radians" do
0
+ @im.send(:sin!, Math::PI).should be_close(0.0, TOLERANCE)
0
+ @im.send(:sin!, 0).should be_close(0.0, TOLERANCE)
0
+ @im.send(:sin!, Math::PI/2).should be_close(1.0, TOLERANCE)
0
+ @im.send(:sin!, 3*Math::PI/2).should be_close(-1.0, TOLERANCE)
0
+ @im.send(:sin!, 2*Math::PI).should be_close(0.0, TOLERANCE)
0
+ it "raises a TypeError when passed a Complex number" do
0
+ lambda { @im.send(:sin!, Complex(4, 5)) }.should raise_error(TypeError)
0
- it "needs to be reviewed for spec completeness" do
0
+ it "returns the sine of the passed argument expressed in radians" do
0
+ Math.sin(Math::PI).should be_close(0.0, TOLERANCE)
0
+ Math.sin(0).should be_close(0.0, TOLERANCE)
0
+ Math.sin(Math::PI/2).should be_close(1.0, TOLERANCE)
0
+ Math.sin(3*Math::PI/2).should be_close(-1.0, TOLERANCE)
0
+ Math.sin(2*Math::PI).should be_close(0.0, TOLERANCE)
0
+ Math.sin(Complex(0, Math::PI)).should be_close(Complex(0.0, 11.5487393572577), TOLERANCE)
0
+ Math.sin(Complex(3, 4)).should be_close(Complex(3.85373803791938, -27.0168132580039), TOLERANCE)
0
+describe "Math.sin!" do
0
+ it "returns the sine of the passed argument expressed in radians" do
0
+ Math.sin(Math::PI).should be_close(0.0, TOLERANCE)
0
+ Math.sin(0).should be_close(0.0, TOLERANCE)
0
+ Math.sin(Math::PI/2).should be_close(1.0, TOLERANCE)
0
+ Math.sin(3*Math::PI/2).should be_close(-1.0, TOLERANCE)
0
+ Math.sin(2*Math::PI).should be_close(0.0, TOLERANCE)
0
+ it "raises a TypeError when passed a Complex number" do
0
+ lambda { Math.sin!(Complex(4, 5)) }.should raise_error(TypeError)