0
我正在從RSpec 2遷移到RSpec 3.儘管試圖使用Rspec 2.99.2刪除所有的棄用,我已解決所有其他棄用。除,如何解決RSpec中不匹配的元素棄用2.99.2
stubbing implementations with mismatched arity is deprecated. Called from /path/to/file.rb:60:in `block in deliver_grouped_system_event_notification'.
stubbing implementations with mismatched arity is deprecated. Called from /path/to/file.rb:26:in `send_notification'.
這是文件:60
supports.each{ |support, system_events| Mailer.grouped_system_event_email(support, system_events).deliver_now }
這是原來的方法
def grouped_system_event_email(support, system_events)
@recipients = support.email
@subject = "[ #{ENVIRONMENT_NAME} Grouped System Event List] #{system_events.first.customer.symbol}"
@system_events = system_events
mail(to: @recipients, subject: @subject)
端
這是它是存根
Mailer.stub :grouped_system_event_email, &@email_spy
拉姆達& @email_spy
@email_spy = lambda do
@email_sent = true
stub = OpenStruct.new
stub.stub :deliver_now
stub
end