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

Tests for OptionMerger with keyword arguments

This commit is contained in:
Akira Matsuda 2019-09-13 18:06:37 +09:00
parent 926cfdb4e3
commit 154b7ffd97

View file

@ -15,6 +15,8 @@ class OptionMergerTest < ActiveSupport::TestCase
assert_equal local_options, method_with_options(local_options)
assert_equal @options.merge(local_options),
o.method_with_options(local_options)
assert_equal @options.merge(local_options), o.method_with_kwargs(local_options)
assert_equal @options.merge(local_options), o.method_with_kwargs_only(local_options)
end
end
@ -22,6 +24,8 @@ class OptionMergerTest < ActiveSupport::TestCase
with_options(@options) do |o|
assert_equal Hash.new, method_with_options
assert_equal @options, o.method_with_options
assert_equal @options, o.method_with_kwargs
assert_equal @options, o.method_with_kwargs_only
end
end
@ -94,4 +98,12 @@ class OptionMergerTest < ActiveSupport::TestCase
def method_with_options(options = {})
options
end
def method_with_kwargs(*args, **options)
options
end
def method_with_kwargs_only(**options)
options
end
end