1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Refined "Drop support for ruby 2.4 from ruby/spec"

By using spec/mspec/tool/remove_old_guards.rb.
This commit is contained in:
Nobuyoshi Nakada 2020-04-03 09:44:40 +09:00
parent f49a24201c
commit 18f7d3c9a6
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
Notes: git 2020-04-03 10:37:05 +09:00
9 changed files with 197 additions and 163 deletions

View file

@ -259,13 +259,13 @@ describe "An ensure block inside 'do end' block" do
it "is executed when an exception is raised in it's corresponding begin block" do
-> {
eval(<<-ruby).call
lambda do
ScratchPad << :begin
raise EnsureSpec::Error
ensure
ScratchPad << :ensure
end
ruby
lambda do
ScratchPad << :begin
raise EnsureSpec::Error
ensure
ScratchPad << :ensure
end
ruby
}.should raise_error(EnsureSpec::Error)
ScratchPad.recorded.should == [:begin, :ensure]
@ -273,15 +273,15 @@ describe "An ensure block inside 'do end' block" do
it "is executed when an exception is raised and rescued in it's corresponding begin block" do
eval(<<-ruby).call
lambda do
ScratchPad << :begin
raise "An exception occurred!"
rescue
ScratchPad << :rescue
ensure
ScratchPad << :ensure
end
ruby
lambda do
ScratchPad << :begin
raise "An exception occurred!"
rescue
ScratchPad << :rescue
ensure
ScratchPad << :ensure
end
ruby
ScratchPad.recorded.should == [:begin, :rescue, :ensure]
end
@ -289,15 +289,15 @@ describe "An ensure block inside 'do end' block" do
it "is executed even when a symbol is thrown in it's corresponding begin block" do
catch(:symbol) do
eval(<<-ruby).call
lambda do
ScratchPad << :begin
throw(:symbol)
rescue
ScratchPad << :rescue
ensure
ScratchPad << :ensure
end
ruby
lambda do
ScratchPad << :begin
throw(:symbol)
rescue
ScratchPad << :rescue
ensure
ScratchPad << :ensure
end
ruby
end
ScratchPad.recorded.should == [:begin, :ensure]
@ -305,26 +305,26 @@ describe "An ensure block inside 'do end' block" do
it "is executed when nothing is raised or thrown in it's corresponding begin block" do
eval(<<-ruby).call
lambda do
ScratchPad << :begin
rescue
ScratchPad << :rescue
ensure
ScratchPad << :ensure
end
ruby
lambda do
ScratchPad << :begin
rescue
ScratchPad << :rescue
ensure
ScratchPad << :ensure
end
ruby
ScratchPad.recorded.should == [:begin, :ensure]
end
it "has no return value" do
result = eval(<<-ruby).call
lambda do
:begin
ensure
:ensure
end
ruby
lambda do
:begin
ensure
:ensure
end
ruby
result.should == :begin
end