From 0cb3cc4ff794b9c3e92afa97a6d3c8e3acbf16ac Mon Sep 17 00:00:00 2001 From: Pavel Pravosud Date: Tue, 29 Jul 2014 13:50:56 -0400 Subject: Add implicit receiver support to `Object#with_options` --- activesupport/test/option_merger_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activesupport/test/option_merger_test.rb') 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 -- cgit v1.2.3