summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2019-12-23 02:34:16 -0500
committerMarc-Andre Lafortune <github@marc-andre.ca>2019-12-23 16:47:33 -0500
commit819b604037c317d2b53a1aaca67aef25da2d5ec9 (patch)
tree0dfc97bef8bdac44091e2c627325ed61fd61a16c /test/-ext-
parentdf6f5c44af1f261fa940ec3954468be8b820450e (diff)
Reword keyword arguments warning messages to convey these are deprecation warnings
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/funcall/test_passing_block.rb8
-rw-r--r--test/-ext-/test_scan_args.rb26
2 files changed, 17 insertions, 17 deletions
diff --git a/test/-ext-/funcall/test_passing_block.rb b/test/-ext-/funcall/test_passing_block.rb
index dd67b7c..d116487 100644
--- a/test/-ext-/funcall/test_passing_block.rb
+++ b/test/-ext-/funcall/test_passing_block.rb
@@ -29,7 +29,7 @@ class TestFuncall < Test::Unit::TestCase
assert_equal([[{}], {}], Relay.with_funcall_passing_block_kw(2, {}, **{}, &block))
assert_equal([[], {a: 1}], Relay.with_funcall_passing_block_kw(3, a: 1, &block))
assert_equal([[{a: 1}], {}], Relay.with_funcall_passing_block_kw(3, {a: 1}, **{}, &block))
- assert_warn(/warning: The keyword argument is passed as the last hash parameter.*The called method is defined here/m) do
+ assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method is defined here/m) do
assert_equal({}, Relay.with_funcall_passing_block_kw(3, **{}, &->(a){a}))
end
end
@@ -53,7 +53,7 @@ class TestFuncall < Test::Unit::TestCase
assert_equal([[], {a: 1}], Relay.with_funcallv_public_kw(o, :foo, 3, a: 1))
assert_equal([[{a: 1}], {}], Relay.with_funcallv_public_kw(o, :foo, 3, {a: 1}, **{}))
assert_raise(NoMethodError) { Relay.with_funcallv_public_kw(o, :bar, 3, {a: 1}, **{}) }
- assert_warn(/warning: The keyword argument is passed as the last hash parameter.*The called method `baz'/m) do
+ assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method `baz'/m) do
assert_equal({}, Relay.with_funcallv_public_kw(o, :baz, 3, **{}))
end
end
@@ -64,11 +64,11 @@ class TestFuncall < Test::Unit::TestCase
assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(1, [{a: 1}], &block))
assert_equal([[1], {a: 1}], Relay.with_yield_splat_kw(1, [1, {a: 1}], &block))
assert_equal([[{}], {}], Relay.with_yield_splat_kw(2, [{}], **{}, &block))
- assert_warn(/warning: The last argument is used as keyword parameters.*The called method is defined here/m) do
+ assert_warn(/warning: Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(3, [{a: 1}], &block))
end
assert_equal([[{a: 1}], {}], Relay.with_yield_splat_kw(3, [{a: 1}], **{}, &block))
- assert_warn(/warning: The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal({}, Relay.with_yield_splat_kw(3, [], **{}, &->(a){a}))
end
end
diff --git a/test/-ext-/test_scan_args.rb b/test/-ext-/test_scan_args.rb
index 949495d..dda016d 100644
--- a/test/-ext-/test_scan_args.rb
+++ b/test/-ext-/test_scan_args.rb
@@ -93,12 +93,12 @@ class TestScanArgs < Test::Unit::TestCase
assert_equal([1, "a", nil], Bug::ScanArgs.lead_hash("a"))
assert_raise(ArgumentError) {Bug::ScanArgs.lead_hash("a", "b")}
assert_equal([1, "a", {b: 1}], Bug::ScanArgs.lead_hash("a", b: 1))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, {b: 1}, nil], Bug::ScanArgs.lead_hash(b: 1))
end
assert_equal([1, {"a"=>0, b: 1}, nil], Bug::ScanArgs.lead_hash({"a"=>0, b: 1}, **{}))
assert_raise(ArgumentError) {Bug::ScanArgs.lead_hash(1, {"a"=>0, b: 1}, **{})}
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, {}, nil], Bug::ScanArgs.lead_hash(**{}))
end
end
@@ -120,7 +120,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_equal([2, "a", "b", nil], Bug::ScanArgs.lead_opt_hash("a", "b"))
assert_equal([1, "a", nil, {c: 1}], Bug::ScanArgs.lead_opt_hash("a", c: 1))
assert_equal([2, "a", "b", {c: 1}], Bug::ScanArgs.lead_opt_hash("a", "b", c: 1))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, {c: 1}, nil, nil], Bug::ScanArgs.lead_opt_hash(c: 1))
end
assert_raise(ArgumentError) {Bug::ScanArgs.lead_opt_hash("a", "b", "c")}
@@ -145,7 +145,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_equal([2, "a", ["b"], nil], Bug::ScanArgs.lead_var_hash("a", "b"))
assert_equal([2, "a", ["b"], {c: 1}], Bug::ScanArgs.lead_var_hash("a", "b", c: 1))
assert_equal([1, "a", [], {c: 1}], Bug::ScanArgs.lead_var_hash("a", c: 1))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, {c: 1}, [], nil], Bug::ScanArgs.lead_var_hash(c: 1))
end
assert_equal([3, "a", ["b", "c"], nil], Bug::ScanArgs.lead_var_hash("a", "b", "c"))
@@ -173,7 +173,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_equal([2, "a", "b", [], nil], Bug::ScanArgs.lead_opt_var_hash("a", "b"))
assert_equal([2, "a", "b", [], {c: 1}], Bug::ScanArgs.lead_opt_var_hash("a", "b", c: 1))
assert_equal([1, "a", nil, [], {c: 1}], Bug::ScanArgs.lead_opt_var_hash("a", c: 1))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, {c: 1}, nil, [], nil], Bug::ScanArgs.lead_opt_var_hash(c: 1))
end
assert_equal([3, "a", "b", ["c"], nil], Bug::ScanArgs.lead_opt_var_hash("a", "b", "c"))
@@ -189,7 +189,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_equal([2, "a", "b", nil], Bug::ScanArgs.opt_trail_hash("a", "b"))
assert_equal([1, nil, "a", {c: 1}], Bug::ScanArgs.opt_trail_hash("a", c: 1))
assert_equal([2, "a", "b", {c: 1}], Bug::ScanArgs.opt_trail_hash("a", "b", c: 1))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, nil, {c: 1}, nil], Bug::ScanArgs.opt_trail_hash(c: 1))
end
assert_raise(ArgumentError) {Bug::ScanArgs.opt_trail_hash("a", "b", "c")}
@@ -203,7 +203,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_raise(ArgumentError) {Bug::ScanArgs.lead_opt_trail_hash("a")}
assert_raise(ArgumentError) {Bug::ScanArgs.lead_opt_trail_hash(c: 1)}
assert_equal([2, "a", nil, "b", nil], Bug::ScanArgs.lead_opt_trail_hash("a", "b"))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([2, "a", nil, {c: 1}, nil], Bug::ScanArgs.lead_opt_trail_hash("a", c: 1))
end
assert_equal([2, "a", nil, "b", {c: 1}], Bug::ScanArgs.lead_opt_trail_hash("a", "b", c: 1))
@@ -221,7 +221,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_equal([2, ["a"], "b", nil], Bug::ScanArgs.var_trail_hash("a", "b"))
assert_equal([1, [], "a", {c: 1}], Bug::ScanArgs.var_trail_hash("a", c: 1))
assert_equal([2, ["a"], "b", {c: 1}], Bug::ScanArgs.var_trail_hash("a", "b", c: 1))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, [], {c: 1}, nil], Bug::ScanArgs.var_trail_hash(c: 1))
end
assert_equal([3, ["a", "b"], "c", nil], Bug::ScanArgs.var_trail_hash("a", "b", "c"))
@@ -235,7 +235,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_raise(ArgumentError) {Bug::ScanArgs.lead_var_trail_hash()}
assert_raise(ArgumentError) {Bug::ScanArgs.lead_var_trail_hash("a")}
assert_raise(ArgumentError) {Bug::ScanArgs.lead_var_trail_hash(c: 1)}
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([2, "a", [], {c: 1}, nil], Bug::ScanArgs.lead_var_trail_hash("a", c: 1))
end
assert_equal([2, "a", [], "b", nil], Bug::ScanArgs.lead_var_trail_hash("a", "b"))
@@ -250,7 +250,7 @@ class TestScanArgs < Test::Unit::TestCase
def test_opt_var_trail_hash
assert_raise(ArgumentError) {Bug::ScanArgs.opt_var_trail_hash()}
assert_equal([1, nil, [], "a", nil], Bug::ScanArgs.opt_var_trail_hash("a"))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, nil, [], {c: 1}, nil], Bug::ScanArgs.opt_var_trail_hash(c: 1))
end
assert_equal([1, nil, [], "a", {c: 1}], Bug::ScanArgs.opt_var_trail_hash("a", c: 1))
@@ -266,7 +266,7 @@ class TestScanArgs < Test::Unit::TestCase
def test_lead_opt_var_trail_hash
assert_raise(ArgumentError) {Bug::ScanArgs.lead_opt_var_trail_hash()}
assert_raise(ArgumentError) {Bug::ScanArgs.lead_opt_var_trail_hash("a")}
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([2, "a", nil, [], {b: 1}, nil], Bug::ScanArgs.lead_opt_var_trail_hash("a", b: 1))
end
assert_equal([2, "a", nil, [], "b", nil], Bug::ScanArgs.lead_opt_var_trail_hash("a", "b"))
@@ -285,7 +285,7 @@ class TestScanArgs < Test::Unit::TestCase
assert_equal([1, "a", nil, {c: 1}], Bug::ScanArgs.k_lead_opt_hash("a", {c: 1}))
assert_equal([2, "a", "b", {c: 1}], Bug::ScanArgs.k_lead_opt_hash("a", "b", c: 1))
assert_equal([2, "a", "b", {c: 1}], Bug::ScanArgs.k_lead_opt_hash("a", "b", {c: 1}))
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, {c: 1}, nil, nil], Bug::ScanArgs.k_lead_opt_hash(c: 1))
end
assert_warn(/The last argument is split into positional and keyword parameters/) do
@@ -294,7 +294,7 @@ class TestScanArgs < Test::Unit::TestCase
end
def test_e_lead_opt_hash
- assert_warn(/The keyword argument is passed as the last hash parameter/) do
+ assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
assert_equal([1, {}, nil, nil], Bug::ScanArgs.e_lead_opt_hash)
end
assert_equal([1, "a", nil, nil], Bug::ScanArgs.e_lead_opt_hash("a"))