From 9eaa0a3449595d07fe2ada5c4c93ec226622147c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Nov 2008 16:48:14 +0100 Subject: =?UTF-8?q?Added=20lambda=20merging=20to=20OptionMerger=20(especia?= =?UTF-8?q?lly=20useful=20with=20named=5Fscope=20and=20with=5Foptions)=20[?= =?UTF-8?q?#740=20state:committed]=20(Pawe=C5=82=20Kondzior)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activesupport/test/option_merger_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport/test') 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 -- cgit v1.2.3