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