summaryrefslogtreecommitdiff
path: root/spec/ruby/core/integer/lcm_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/integer/lcm_spec.rb')
-rw-r--r--spec/ruby/core/integer/lcm_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/core/integer/lcm_spec.rb b/spec/ruby/core/integer/lcm_spec.rb
index ddf25d3853..6659247d1e 100644
--- a/spec/ruby/core/integer/lcm_spec.rb
+++ b/spec/ruby/core/integer/lcm_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../../../spec_helper', __FILE__)
+require_relative '../../spec_helper'
describe "Integer#lcm" do
it "returns self if equal to the argument" do
@@ -7,8 +7,8 @@ describe "Integer#lcm" do
end
it "returns an Integer" do
- 36.lcm(6).should be_kind_of(Integer)
- 4.lcm(20981).should be_kind_of(Integer)
+ 36.lcm(6).should.is_a?(Integer)
+ 4.lcm(20981).should.is_a?(Integer)
end
it "returns the least common multiple of self and argument" do
@@ -33,26 +33,26 @@ describe "Integer#lcm" do
it "accepts a Bignum argument" do
bignum = 9999**99
- bignum.should be_kind_of(Bignum)
+ bignum.should.is_a?(Integer)
99.lcm(bignum).should == bignum
end
it "works if self is a Bignum" do
bignum = 9999**99
- bignum.should be_kind_of(Bignum)
+ bignum.should.is_a?(Integer)
bignum.lcm(99).should == bignum
end
it "raises an ArgumentError if not given an argument" do
- lambda { 12.lcm }.should raise_error(ArgumentError)
+ -> { 12.lcm }.should.raise(ArgumentError)
end
it "raises an ArgumentError if given more than one argument" do
- lambda { 12.lcm(30, 20) }.should raise_error(ArgumentError)
+ -> { 12.lcm(30, 20) }.should.raise(ArgumentError)
end
it "raises a TypeError unless the argument is an Integer" do
- lambda { 39.lcm(3.8) }.should raise_error(TypeError)
- lambda { 45872.lcm([]) }.should raise_error(TypeError)
+ -> { 39.lcm(3.8) }.should.raise(TypeError)
+ -> { 45872.lcm([]) }.should.raise(TypeError)
end
end