mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Update tests for full keyword argument separation
This commit is contained in:
parent
beae6cbf0f
commit
ff96565686
Notes:
git
2020-01-03 11:41:09 +09:00
12 changed files with 556 additions and 1694 deletions
|
@ -945,8 +945,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||
assert_raise(ArgumentError) {warn("test warning", uplevel: -1)}
|
||||
assert_in_out_err(["-e", "warn 'ok', uplevel: 1"], '', [], /warning:/)
|
||||
warning = capture_warning_warn {warn("test warning", {uplevel: 0})}
|
||||
assert_equal("#{__FILE__}:#{__LINE__-1}: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call\n", warning[0])
|
||||
assert_match(/warning: The called method (?:`.*' )?is defined here|warning: test warning/, warning[1])
|
||||
assert_match(/test warning.*{:uplevel=>0}/m, warning[0])
|
||||
warning = capture_warning_warn {warn("test warning", **{uplevel: 0})}
|
||||
assert_equal("#{__FILE__}:#{__LINE__-1}: warning: test warning\n", warning[0])
|
||||
warning = capture_warning_warn {warn("test warning", {uplevel: 0}, **{})}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue