I have a service with the call method to stub. But its always have this error:
SomeTest#test_1:
ArgumentError: mocked method :call expects 0 arguments, got 1
test.rb:17:in `block in test_1'
test.rb:16:in `test_1'
Here's the code:
require 'minitest/autorun'
class SomeService
def initialize(headers = {})
end
def call
end
end
class SomeTest < Minitest::Test
def test_1
mock = Minitest::Mock.new
mock.expect :call, nil
SomeService.stub :new, mock do
SomeService.new({}).call
end
end
end
What did I do wrong? thanks