diff options
Diffstat (limited to 'spec/ruby/core/random/new_spec.rb')
| -rw-r--r-- | spec/ruby/core/random/new_spec.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/ruby/core/random/new_spec.rb b/spec/ruby/core/random/new_spec.rb index 4280b5b9c3..e20d487137 100644 --- a/spec/ruby/core/random/new_spec.rb +++ b/spec/ruby/core/random/new_spec.rb @@ -1,16 +1,17 @@ +require_relative "../../spec_helper" describe "Random.new" do it "returns a new instance of Random" do - Random.new.should be_an_instance_of(Random) + Random.new.should.instance_of?(Random) end it "uses a random seed value if none is supplied" do - Random.new.seed.should be_an_instance_of(Integer) + Random.new.seed.should.instance_of?(Integer) end it "returns Random instances initialized with different seeds" do first = Random.new second = Random.new - (0..20).map { first.rand } .should_not == (0..20).map { second.rand } + (0..20).map { first.rand }.should_not == (0..20).map { second.rand } end it "accepts an Integer seed value as an argument" do @@ -32,6 +33,6 @@ describe "Random.new" do it "raises a RangeError if passed a Complex (with imaginary part) seed value as an argument" do -> do Random.new(Complex(20,2)) - end.should raise_error(RangeError) + end.should.raise(RangeError) end end |
