Skip to content

Commit

Permalink
Remove redundant deprecation disabling in MockTest
Browse files Browse the repository at this point in the history
I'm not sure these calls to DeprecationDisabler.disable_deprecations
were ever necessary. Currently the relevant deprecation warnings are
only every displayed if the reinstate_undocumented_behaviour_from_v1_9
configuration option is true which is the default. Perhaps this wasn't
always the case and these calls are a vestige of that...? Anyway, they
certainly aren't needed now.
  • Loading branch information
floehopper committed Oct 18, 2022
1 parent 942ddad commit dc8ca96
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions test/acceptance/mock_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ def test_should_build_string_named_mock_and_explicitly_add_an_expectation_which_
def test_should_build_symbol_named_mock_and_explicitly_add_an_expectation_which_is_satisfied
test_result = run_as_test do
Mocha::Configuration.override(:reinstate_undocumented_behaviour_from_v1_9 => false) do
DeprecationDisabler.disable_deprecations do
foo = mock(:foo)
foo.expects(:bar)
foo.bar
end
foo = mock(:foo)
foo.expects(:bar)
foo.bar
end
end
assert_passed(test_result)
Expand Down Expand Up @@ -109,11 +107,9 @@ def test_should_build_string_named_mock_incorporating_two_expectations_which_are
def test_should_build_symbol_named_mock_incorporating_two_expectations_which_are_satisifed
test_result = run_as_test do
Mocha::Configuration.override(:reinstate_undocumented_behaviour_from_v1_9 => false) do
DeprecationDisabler.disable_deprecations do
foo = mock(:foo, :bar => 'bar', :baz => 'baz')
foo.bar
foo.baz
end
foo = mock(:foo, :bar => 'bar', :baz => 'baz')
foo.bar
foo.baz
end
end
assert_passed(test_result)
Expand Down

0 comments on commit dc8ca96

Please sign in to comment.