2 ms·
"expect(widget_factory).to have_received(:create).with({name: 'sprocket'})" Even better: expect("my_service.rb", "line X").to be("widget_factory.create") Or
by al2o3cr 13y ago
"expect(widget_factory).to have_received(:create).with({name: 'sprocket'})"
Even better:
expect("my_service.rb", "line X").to be("widget_factory.create")
Or yet better, simply:
; # realize that testing the exact implementation is bullshit