diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-15 16:48:14 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-15 16:48:14 +0100 |
commit | 9eaa0a3449595d07fe2ada5c4c93ec226622147c (patch) | |
tree | 9bf645cc94377fcdc49846c1aadddf6b2dab0702 /activesupport/test/option_merger_test.rb | |
parent | 8d8195dc2443755786d3a8598b7c2da1f08a38e7 (diff) | |
download | rails-9eaa0a3449595d07fe2ada5c4c93ec226622147c.tar.gz rails-9eaa0a3449595d07fe2ada5c4c93ec226622147c.tar.bz2 rails-9eaa0a3449595d07fe2ada5c4c93ec226622147c.zip |
Added lambda merging to OptionMerger (especially useful with named_scope and with_options) [#740 state:committed] (Paweł Kondzior)
Diffstat (limited to 'activesupport/test/option_merger_test.rb')
-rw-r--r-- | activesupport/test/option_merger_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/option_merger_test.rb b/activesupport/test/option_merger_test.rb index 0d72314880..f26d61617d 100644 --- a/activesupport/test/option_merger_test.rb +++ b/activesupport/test/option_merger_test.rb @@ -64,6 +64,14 @@ class OptionMergerTest < Test::Unit::TestCase end end end + + def test_nested_method_with_options_using_lamdba + local_lamdba = lambda { { :lambda => true } } + with_options(@options) do |o| + assert_equal @options.merge(local_lamdba.call), + o.method_with_options(local_lamdba).call + end + end # Needed when counting objects with the ObjectSpace def test_option_merger_class_method |