diff options
author | David Heinemeier Hansson <david@basecamp.com> | 2014-07-29 13:38:24 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@basecamp.com> | 2014-07-29 13:38:24 -0700 |
commit | c56997eb1b4005f59f63d9cb2203424c905cd4b8 (patch) | |
tree | b210d4d3fd45153cab1bbda471e248a47d1e8474 /activesupport/test | |
parent | 160cc6956c3c9da0eab66546d3c266d9f317bbc1 (diff) | |
parent | 0cb3cc4ff794b9c3e92afa97a6d3c8e3acbf16ac (diff) | |
download | rails-c56997eb1b4005f59f63d9cb2203424c905cd4b8.tar.gz rails-c56997eb1b4005f59f63d9cb2203424c905cd4b8.tar.bz2 rails-c56997eb1b4005f59f63d9cb2203424c905cd4b8.zip |
Merge pull request #16339 from rwz/with_options_implicit
Add implicit receiver support to `Object#with_options`
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/option_merger_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/option_merger_test.rb b/activesupport/test/option_merger_test.rb index 9d139b61b8..4c0364e68b 100644 --- a/activesupport/test/option_merger_test.rb +++ b/activesupport/test/option_merger_test.rb @@ -79,6 +79,15 @@ class OptionMergerTest < ActiveSupport::TestCase assert_equal ActiveSupport::OptionMerger, ActiveSupport::OptionMerger.new('', '').class end + def test_option_merger_implicit_receiver + @options.with_options foo: "bar" do + merge! fizz: "buzz" + end + + expected = { hello: "world", foo: "bar", fizz: "buzz" } + assert_equal expected, @options + end + private def method_with_options(options = {}) options |