1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -20,7 +20,7 @@ describe "Exception#dup" do
it "does not copy singleton methods" do
def @obj.special() :the_one end
dup = @obj.dup
lambda { dup.special }.should raise_error(NameError)
-> { dup.special }.should raise_error(NameError)
end
it "does not copy modules included in the singleton class" do
@ -29,7 +29,7 @@ describe "Exception#dup" do
end
dup = @obj.dup
lambda { dup.repr }.should raise_error(NameError)
-> { dup.repr }.should raise_error(NameError)
end
it "does not copy constants defined in the singleton class" do
@ -38,7 +38,7 @@ describe "Exception#dup" do
end
dup = @obj.dup
lambda { class << dup; CLONE; end }.should raise_error(NameError)
-> { class << dup; CLONE; end }.should raise_error(NameError)
end
it "does copy the message" do

View file

@ -20,7 +20,7 @@ describe "StopIteration#result" do
it "returns the method-returned-object from an Enumerator" do
@enum.next
@enum.next
lambda { @enum.next }.should(
-> { @enum.next }.should(
raise_error(StopIteration) do |error|
error.result.should equal(:method_returned)
end

View file

@ -36,21 +36,21 @@ describe "Exception#set_backtrace" do
it "raises a TypeError when passed a Symbol" do
err = RuntimeError.new
lambda { err.set_backtrace :unhappy }.should raise_error(TypeError)
-> { err.set_backtrace :unhappy }.should raise_error(TypeError)
end
it "raises a TypeError when the Array contains a Symbol" do
err = RuntimeError.new
lambda { err.set_backtrace ["String", :unhappy] }.should raise_error(TypeError)
-> { err.set_backtrace ["String", :unhappy] }.should raise_error(TypeError)
end
it "raises a TypeError when the array contains nil" do
err = Exception.new
lambda { err.set_backtrace ["String", nil] }.should raise_error(TypeError)
-> { err.set_backtrace ["String", nil] }.should raise_error(TypeError)
end
it "raises a TypeError when the argument is a nested array" do
err = Exception.new
lambda { err.set_backtrace ["String", ["String"]] }.should raise_error(TypeError)
-> { err.set_backtrace ["String", ["String"]] }.should raise_error(TypeError)
end
end

View file

@ -9,7 +9,7 @@ describe "SignalException.new" do
end
it "raises an exception with an invalid signal number" do
lambda { SignalException.new(100000) }.should raise_error(ArgumentError)
-> { SignalException.new(100000) }.should raise_error(ArgumentError)
end
it "takes a signal name without SIG prefix as the first argument" do
@ -27,7 +27,7 @@ describe "SignalException.new" do
end
it "raises an exception with an invalid signal name" do
lambda { SignalException.new("NONEXISTENT") }.should raise_error(ArgumentError)
-> { SignalException.new("NONEXISTENT") }.should raise_error(ArgumentError)
end
it "takes a signal symbol without SIG prefix as the first argument" do
@ -45,7 +45,7 @@ describe "SignalException.new" do
end
it "raises an exception with an invalid signal name" do
lambda { SignalException.new(:NONEXISTENT) }.should raise_error(ArgumentError)
-> { SignalException.new(:NONEXISTENT) }.should raise_error(ArgumentError)
end
it "takes an optional message argument with a signal number" do
@ -56,7 +56,7 @@ describe "SignalException.new" do
end
it "raises an exception for an optional argument with a signal name" do
lambda { SignalException.new("INT","name") }.should raise_error(ArgumentError)
-> { SignalException.new("INT","name") }.should raise_error(ArgumentError)
end
end

View file

@ -21,7 +21,7 @@ end
describe "SystemCallError.new" do
it "requires at least one argument" do
lambda { SystemCallError.new }.should raise_error(ArgumentError)
-> { SystemCallError.new }.should raise_error(ArgumentError)
end
it "accepts single Fixnum argument as errno" do