From 2f821a0a987902cbe69ba04eb2fe04ea757682a3 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Fri, 19 Feb 2010 10:31:51 -0800 Subject: Fix test ordering bug related to introducing masked Name class --- activesupport/test/core_ext/module_test.rb | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'activesupport') diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb index 1fe75d5930..9edd7cc7c0 100644 --- a/activesupport/test/core_ext/module_test.rb +++ b/activesupport/test/core_ext/module_test.rb @@ -55,18 +55,6 @@ class Name end end -$nowhere = <<-EOF -class Name - delegate :nowhere -end -EOF - -$noplace = <<-EOF -class Name - delegate :noplace, :tos => :hollywood -end -EOF - class ModuleTest < Test::Unit::TestCase def setup @david = Someone.new("David", Somewhere.new("Paulina", "Chicago")) @@ -87,8 +75,12 @@ class ModuleTest < Test::Unit::TestCase end def test_missing_delegation_target - assert_raise(ArgumentError) { eval($nowhere) } - assert_raise(ArgumentError) { eval($noplace) } + assert_raise(ArgumentError) do + Name.send :delegate, :nowhere + end + assert_raise(ArgumentError) do + Name.send :delegate, :noplace, :tos => :hollywood + end end def test_delegation_prefix -- cgit v1.2.3