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:
parent
926cfdb4e3
commit
154b7ffd97
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue