summaryrefslogtreecommitdiff
path: root/spec/ruby/language
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2024-02-15 13:00:32 +0900
committerYusuke Endoh <mame@ruby-lang.org>2024-02-15 18:42:31 +0900
commit8259f35adc67ab34bb521f0e8a298fb00629b958 (patch)
treeb7ddb8c804334616362def40f380a29b3ffca6ea /spec/ruby/language
parent25d74b9527cd525042ad0b612b794fa331d3a318 (diff)
ruby-spec: Accept both a backtick and a single quote in error messages
Diffstat (limited to 'spec/ruby/language')
-rw-r--r--spec/ruby/language/numbered_parameters_spec.rb2
-rw-r--r--spec/ruby/language/predefined_spec.rb4
-rw-r--r--spec/ruby/language/rescue_spec.rb2
-rw-r--r--spec/ruby/language/variables_spec.rb2
4 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/language/numbered_parameters_spec.rb b/spec/ruby/language/numbered_parameters_spec.rb
index 3a35cf1465..06f9948c58 100644
--- a/spec/ruby/language/numbered_parameters_spec.rb
+++ b/spec/ruby/language/numbered_parameters_spec.rb
@@ -22,7 +22,7 @@ describe "Numbered parameters" do
it "does not support more than 9 parameters" do
-> {
proc { [_10] }.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
- }.should raise_error(NameError, /undefined local variable or method `_10'/)
+ }.should raise_error(NameError, /undefined local variable or method [`']_10'/)
end
it "can not be used in both outer and nested blocks at the same time" do
diff --git a/spec/ruby/language/predefined_spec.rb b/spec/ruby/language/predefined_spec.rb
index fe865cc325..ed823f185a 100644
--- a/spec/ruby/language/predefined_spec.rb
+++ b/spec/ruby/language/predefined_spec.rb
@@ -687,7 +687,7 @@ describe "Predefined global $," do
end
it "warns if assigned non-nil" do
- -> { $, = "_" }.should complain(/warning: `\$,' is deprecated/)
+ -> { $, = "_" }.should complain(/warning: [`']\$,' is deprecated/)
end
end
@@ -724,7 +724,7 @@ describe "Predefined global $;" do
end
it "warns if assigned non-nil" do
- -> { $; = "_" }.should complain(/warning: `\$;' is deprecated/)
+ -> { $; = "_" }.should complain(/warning: [`']\$;' is deprecated/)
end
end
diff --git a/spec/ruby/language/rescue_spec.rb b/spec/ruby/language/rescue_spec.rb
index 69ed038fda..d8ba14378f 100644
--- a/spec/ruby/language/rescue_spec.rb
+++ b/spec/ruby/language/rescue_spec.rb
@@ -263,7 +263,7 @@ describe "The rescue keyword" do
rescue ArgumentError
end
rescue StandardError => e
- e.backtrace.first.should include ":in `raise_standard_error'"
+ e.backtrace.first.should =~ /:in [`']raise_standard_error'/
else
fail("exception wasn't handled by the correct rescue block")
end
diff --git a/spec/ruby/language/variables_spec.rb b/spec/ruby/language/variables_spec.rb
index 53d191b456..01be61a9dc 100644
--- a/spec/ruby/language/variables_spec.rb
+++ b/spec/ruby/language/variables_spec.rb
@@ -930,7 +930,7 @@ describe "Instance variables" do
obj = Object.new
def obj.foobar; a = $specs_uninitialized_global_variable; end
- -> { obj.foobar }.should complain(/warning: global variable `\$specs_uninitialized_global_variable' not initialized/, verbose: true)
+ -> { obj.foobar }.should complain(/warning: global variable [`']\$specs_uninitialized_global_variable' not initialized/, verbose: true)
end
it "doesn't warn at lazy initialization" do