diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/option_merger_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/option_merger_test.rb b/activesupport/test/option_merger_test.rb index f5287d5725..e97a4f918b 100644 --- a/activesupport/test/option_merger_test.rb +++ b/activesupport/test/option_merger_test.rb @@ -27,6 +27,22 @@ class OptionMergerTest < Test::Unit::TestCase end end + def test_method_with_options_allows_to_overwrite_options + local_options = {:hello => 'moon'} + assert_equal @options.keys, local_options.keys + + with_options(@options) do |o| + assert_equal local_options, method_with_options(local_options) + assert_equal @options.merge(local_options), + o.method_with_options(local_options) + assert_equal local_options, o.method_with_options(local_options) + end + with_options(local_options) do |o| + assert_equal local_options.merge(@options), + o.method_with_options(@options) + end + end + private def method_with_options(options = {}) options |