summaryrefslogtreecommitdiff
path: root/test/irb/test_context.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/irb/test_context.rb')
-rw-r--r--test/irb/test_context.rb106
1 files changed, 53 insertions, 53 deletions
diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb
index adf472baae..fde1f91c40 100644
--- a/test/irb/test_context.rb
+++ b/test/irb/test_context.rb
@@ -68,7 +68,7 @@ module TestIRB
irb.eval_input
end
assert_empty err
- assert_pattern_list([:*, /\(irb\):1:in `<main>': Foo \(RuntimeError\)\n/,
+ assert_pattern_list([:*, /\(irb\):1:in '<main>': Foo \(RuntimeError\)\n/,
:*, /#<RuntimeError: Foo>\n/,
:*, /0$/,
:*, /0$/,
@@ -89,8 +89,8 @@ module TestIRB
end
assert_empty err
assert_pattern_list([
- :*, /\(irb\):1:in `<main>': Foo \(RuntimeError\)\n/,
- :*, /\(irb\):2:in `<main>': Bar \(RuntimeError\)\n/,
+ :*, /\(irb\):1:in '<main>': Foo \(RuntimeError\)\n/,
+ :*, /\(irb\):2:in '<main>': Bar \(RuntimeError\)\n/,
:*, /#<RuntimeError: Bar>\n/,
], out)
end
@@ -130,9 +130,9 @@ module TestIRB
[:marshal, "123", Marshal.dump(123)],
],
failed: [
- [false, "BasicObject.new", /#<NoMethodError: undefined method `to_s' for/],
- [:p, "class Foo; undef inspect ;end; Foo.new", /#<NoMethodError: undefined method `inspect' for/],
- [:yaml, "BasicObject.new", /#<NoMethodError: undefined method `inspect' for/],
+ [false, "BasicObject.new", /#<NoMethodError: undefined method 'to_s' for/],
+ [:p, "class Foo; undef inspect ;end; Foo.new", /#<NoMethodError: undefined method 'inspect' for/],
+ [:yaml, "BasicObject.new", /#<NoMethodError: undefined method 'inspect' for/],
[:marshal, "[Object.new, Class.new]", /#<TypeError: can't dump anonymous class #<Class:/]
]
}.each do |scenario, cases|
@@ -210,7 +210,7 @@ module TestIRB
end
assert_empty err
assert_match(/An error occurred when inspecting the object: #<RuntimeError: foo>/, out)
- assert_match(/An error occurred when running Kernel#inspect: #<NoMethodError: undefined method `inspect' for/, out)
+ assert_match(/An error occurred when running Kernel#inspect: #<NoMethodError: undefined method 'inspect' for/, out)
ensure
$VERBOSE = verbose
end
@@ -503,15 +503,15 @@ module TestIRB
if RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [
:*, /Traceback \(most recent call last\):\n/,
- :*, /\t 2: from \(irb\):1:in `<main>'\n/,
- :*, /\t 1: from \(irb\):1:in `hoge'\n/,
- :*, /\(irb\):1:in `fuga': unhandled exception\n/,
+ :*, /\t 2: from \(irb\):1:in '<main>'\n/,
+ :*, /\t 1: from \(irb\):1:in 'hoge'\n/,
+ :*, /\(irb\):1:in 'fuga': unhandled exception\n/,
]
else
expected = [
- :*, /\(irb\):1:in `fuga': unhandled exception\n/,
- :*, /\tfrom \(irb\):1:in `hoge'\n/,
- :*, /\tfrom \(irb\):1:in `<main>'\n/,
+ :*, /\(irb\):1:in 'fuga': unhandled exception\n/,
+ :*, /\tfrom \(irb\):1:in 'hoge'\n/,
+ :*, /\tfrom \(irb\):1:in '<main>'\n/,
:*
]
end
@@ -533,15 +533,15 @@ module TestIRB
if RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [
:*, /Traceback \(most recent call last\):\n/,
- :*, /\t 2: from \(irb\):1:in `<main>'\n/,
- :*, /\t 1: from \(irb\):1:in `hoge'\n/,
- :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/,
+ :*, /\t 2: from \(irb\):1:in '<main>'\n/,
+ :*, /\t 1: from \(irb\):1:in 'hoge'\n/,
+ :*, /\(irb\):1:in 'fuga': A\\xF3B \(RuntimeError\)\n/,
]
else
expected = [
- :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/,
- :*, /\tfrom \(irb\):1:in `hoge'\n/,
- :*, /\tfrom \(irb\):1:in `<main>'\n/,
+ :*, /\(irb\):1:in 'fuga': A\\xF3B \(RuntimeError\)\n/,
+ :*, /\tfrom \(irb\):1:in 'hoge'\n/,
+ :*, /\tfrom \(irb\):1:in '<main>'\n/,
:*
]
end
@@ -571,43 +571,43 @@ module TestIRB
expected = [
:*, /Traceback \(most recent call last\):\n/,
:*, /\t... \d+ levels...\n/,
- :*, /\t16: from \(irb\):1:in `a4'\n/,
- :*, /\t15: from \(irb\):1:in `a5'\n/,
- :*, /\t14: from \(irb\):1:in `a6'\n/,
- :*, /\t13: from \(irb\):1:in `a7'\n/,
- :*, /\t12: from \(irb\):1:in `a8'\n/,
- :*, /\t11: from \(irb\):1:in `a9'\n/,
- :*, /\t10: from \(irb\):1:in `a10'\n/,
- :*, /\t 9: from \(irb\):1:in `a11'\n/,
- :*, /\t 8: from \(irb\):1:in `a12'\n/,
- :*, /\t 7: from \(irb\):1:in `a13'\n/,
- :*, /\t 6: from \(irb\):1:in `a14'\n/,
- :*, /\t 5: from \(irb\):1:in `a15'\n/,
- :*, /\t 4: from \(irb\):1:in `a16'\n/,
- :*, /\t 3: from \(irb\):1:in `a17'\n/,
- :*, /\t 2: from \(irb\):1:in `a18'\n/,
- :*, /\t 1: from \(irb\):1:in `a19'\n/,
- :*, /\(irb\):1:in `a20': unhandled exception\n/,
+ :*, /\t16: from \(irb\):1:in 'a4'\n/,
+ :*, /\t15: from \(irb\):1:in 'a5'\n/,
+ :*, /\t14: from \(irb\):1:in 'a6'\n/,
+ :*, /\t13: from \(irb\):1:in 'a7'\n/,
+ :*, /\t12: from \(irb\):1:in 'a8'\n/,
+ :*, /\t11: from \(irb\):1:in 'a9'\n/,
+ :*, /\t10: from \(irb\):1:in 'a10'\n/,
+ :*, /\t 9: from \(irb\):1:in 'a11'\n/,
+ :*, /\t 8: from \(irb\):1:in 'a12'\n/,
+ :*, /\t 7: from \(irb\):1:in 'a13'\n/,
+ :*, /\t 6: from \(irb\):1:in 'a14'\n/,
+ :*, /\t 5: from \(irb\):1:in 'a15'\n/,
+ :*, /\t 4: from \(irb\):1:in 'a16'\n/,
+ :*, /\t 3: from \(irb\):1:in 'a17'\n/,
+ :*, /\t 2: from \(irb\):1:in 'a18'\n/,
+ :*, /\t 1: from \(irb\):1:in 'a19'\n/,
+ :*, /\(irb\):1:in 'a20': unhandled exception\n/,
]
else
expected = [
- :*, /\(irb\):1:in `a20': unhandled exception\n/,
- :*, /\tfrom \(irb\):1:in `a19'\n/,
- :*, /\tfrom \(irb\):1:in `a18'\n/,
- :*, /\tfrom \(irb\):1:in `a17'\n/,
- :*, /\tfrom \(irb\):1:in `a16'\n/,
- :*, /\tfrom \(irb\):1:in `a15'\n/,
- :*, /\tfrom \(irb\):1:in `a14'\n/,
- :*, /\tfrom \(irb\):1:in `a13'\n/,
- :*, /\tfrom \(irb\):1:in `a12'\n/,
- :*, /\tfrom \(irb\):1:in `a11'\n/,
- :*, /\tfrom \(irb\):1:in `a10'\n/,
- :*, /\tfrom \(irb\):1:in `a9'\n/,
- :*, /\tfrom \(irb\):1:in `a8'\n/,
- :*, /\tfrom \(irb\):1:in `a7'\n/,
- :*, /\tfrom \(irb\):1:in `a6'\n/,
- :*, /\tfrom \(irb\):1:in `a5'\n/,
- :*, /\tfrom \(irb\):1:in `a4'\n/,
+ :*, /\(irb\):1:in 'a20': unhandled exception\n/,
+ :*, /\tfrom \(irb\):1:in 'a19'\n/,
+ :*, /\tfrom \(irb\):1:in 'a18'\n/,
+ :*, /\tfrom \(irb\):1:in 'a17'\n/,
+ :*, /\tfrom \(irb\):1:in 'a16'\n/,
+ :*, /\tfrom \(irb\):1:in 'a15'\n/,
+ :*, /\tfrom \(irb\):1:in 'a14'\n/,
+ :*, /\tfrom \(irb\):1:in 'a13'\n/,
+ :*, /\tfrom \(irb\):1:in 'a12'\n/,
+ :*, /\tfrom \(irb\):1:in 'a11'\n/,
+ :*, /\tfrom \(irb\):1:in 'a10'\n/,
+ :*, /\tfrom \(irb\):1:in 'a9'\n/,
+ :*, /\tfrom \(irb\):1:in 'a8'\n/,
+ :*, /\tfrom \(irb\):1:in 'a7'\n/,
+ :*, /\tfrom \(irb\):1:in 'a6'\n/,
+ :*, /\tfrom \(irb\):1:in 'a5'\n/,
+ :*, /\tfrom \(irb\):1:in 'a4'\n/,
:*, /\t... \d+ levels...\n/,
]
end