diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2018-03-21 21:02:36 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2018-03-21 21:02:36 +0100 |
commit | 242ae67ebe98685464b8f23f527e2102dfc3df88 (patch) | |
tree | 0e314fa5b262472a79a9ce8c03d36c94fc9ee1d4 /activesupport/test | |
parent | 958c5ad9e9ba8cf814dfff1ea962876f95f791ea (diff) | |
download | rails-242ae67ebe98685464b8f23f527e2102dfc3df88.tar.gz rails-242ae67ebe98685464b8f23f527e2102dfc3df88.tar.bz2 rails-242ae67ebe98685464b8f23f527e2102dfc3df88.zip |
Use try in tests that try to test try.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/object/try_test.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/activesupport/test/core_ext/object/try_test.rb b/activesupport/test/core_ext/object/try_test.rb index 40d6cdd28e..a838334034 100644 --- a/activesupport/test/core_ext/object/try_test.rb +++ b/activesupport/test/core_ext/object/try_test.rb @@ -78,7 +78,6 @@ class ObjectTryTest < ActiveSupport::TestCase def test_try_with_private_method_bang klass = Class.new do private - def private_method "private method" end @@ -90,7 +89,6 @@ class ObjectTryTest < ActiveSupport::TestCase def test_try_with_private_method klass = Class.new do private - def private_method "private method" end @@ -109,7 +107,6 @@ class ObjectTryTest < ActiveSupport::TestCase end private - def private_delegator_method "private delegator method" end @@ -120,11 +117,11 @@ class ObjectTryTest < ActiveSupport::TestCase end def test_try_with_method_on_delegator_target - assert_equal 5, Decorator.new(@string).size + assert_equal 5, Decorator.new(@string).try(:size) end def test_try_with_overridden_method_on_delegator - assert_equal "overridden reverse", Decorator.new(@string).reverse + assert_equal "overridden reverse", Decorator.new(@string).try(:reverse) end def test_try_with_private_method_on_delegator @@ -140,7 +137,6 @@ class ObjectTryTest < ActiveSupport::TestCase def test_try_with_private_method_on_delegator_target klass = Class.new do private - def private_method "private method" end @@ -152,7 +148,6 @@ class ObjectTryTest < ActiveSupport::TestCase def test_try_with_private_method_on_delegator_target_bang klass = Class.new do private - def private_method "private method" end |