aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/option_merger_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/option_merger_test.rb')
-rw-r--r--activesupport/test/option_merger_test.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/activesupport/test/option_merger_test.rb b/activesupport/test/option_merger_test.rb
index e97a4f918b..db32d4f6c1 100644
--- a/activesupport/test/option_merger_test.rb
+++ b/activesupport/test/option_merger_test.rb
@@ -1,25 +1,20 @@
-require 'test/unit'
-
-unless defined? ActiveSupport::OptionMerger
- require File.dirname(__FILE__) + '/../lib/active_support/option_merger'
- require File.dirname(__FILE__) + '/../lib/active_support/core_ext/object'
-end
+require File.dirname(__FILE__) + '/abstract_unit'
class OptionMergerTest < Test::Unit::TestCase
def setup
@options = {:hello => 'world'}
end
-
+
def test_method_with_options_merges_options_when_options_are_present
local_options = {:cool => true}
-
+
with_options(@options) do |o|
assert_equal local_options, method_with_options(local_options)
- assert_equal @options.merge(local_options),
+ assert_equal @options.merge(local_options),
o.method_with_options(local_options)
end
end
-
+
def test_method_with_options_appends_options_when_options_are_missing
with_options(@options) do |o|
assert_equal Hash.new, method_with_options
@@ -30,10 +25,10 @@ class OptionMergerTest < Test::Unit::TestCase
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),
+ assert_equal @options.merge(local_options),
o.method_with_options(local_options)
assert_equal local_options, o.method_with_options(local_options)
end