From 1da001af23a1f8396785460d6ddc7d113274535b Mon Sep 17 00:00:00 2001 From: Nitish Rathi Date: Mon, 2 Dec 2019 10:06:27 +0000 Subject: [PATCH] [Refactor] inline method error_if_frozen --- lib/mocha/object_methods.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/mocha/object_methods.rb b/lib/mocha/object_methods.rb index a3c01d05f..8625aac03 100644 --- a/lib/mocha/object_methods.rb +++ b/lib/mocha/object_methods.rb @@ -144,14 +144,10 @@ def unstub(*method_names) private def anticipates(expected_methods_vs_return_values, &block) - error_if_frozen - mocha.anticipates(expected_methods_vs_return_values, caller, self, &block) - end - - def error_if_frozen if frozen? raise StubbingError.new("can't stub method on frozen object: #{mocha_inspect}", caller) end + mocha.anticipates(expected_methods_vs_return_values, caller, self, &block) end end end