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)