diff options
author | Pavel Pravosud <pavel@pravosud.com> | 2014-07-29 13:50:56 -0400 |
---|---|---|
committer | Pavel Pravosud <pavel@pravosud.com> | 2014-07-29 16:11:48 -0400 |
commit | 0cb3cc4ff794b9c3e92afa97a6d3c8e3acbf16ac (patch) | |
tree | 260ed53e89080d117f00c537301f178263d3098a /activesupport/test | |
parent | d035124a20e2964074441fb1d4f7b4865eccc1fa (diff) | |
download | rails-0cb3cc4ff794b9c3e92afa97a6d3c8e3acbf16ac.tar.gz rails-0cb3cc4ff794b9c3e92afa97a6d3c8e3acbf16ac.tar.bz2 rails-0cb3cc4ff794b9c3e92afa97a6d3c8e3acbf16ac.zip |
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 |