From 6fc9ac7a1ee9be738071dd02a9f6a36212a25129 Mon Sep 17 00:00:00 2001 From: Yousuke Date: Wed, 10 Jun 2015 12:29:40 +0900 Subject: [PATCH] Deprecate using `with` without arguments. RSpec3.0 prohibit using `with` without arguments. - https://github.com/rspec/rspec-mocks/blob/v3.0.4/lib/rspec/mocks/message_expectation.rb#L336-L339 --- lib/rspec/mocks/message_expectation.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rspec/mocks/message_expectation.rb b/lib/rspec/mocks/message_expectation.rb index 0167a300d..1fe81d5b1 100644 --- a/lib/rspec/mocks/message_expectation.rb +++ b/lib/rspec/mocks/message_expectation.rb @@ -358,6 +358,8 @@ def with(*args, &block) else self.inner_implementation_action = block end + elsif args.empty? + RSpec.deprecate "Using `with` without arguments", :replacement => "`with(no_args)`" end @argument_list_matcher = ArgumentListMatcher.new(*args, &block)