aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/option_merger_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-11-15 16:48:14 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-15 16:48:14 +0100
commit9eaa0a3449595d07fe2ada5c4c93ec226622147c (patch)
tree9bf645cc94377fcdc49846c1aadddf6b2dab0702 /activesupport/test/option_merger_test.rb
parent8d8195dc2443755786d3a8598b7c2da1f08a38e7 (diff)
downloadrails-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.rb8
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