On 4/02/14 1:05 AM, siva wrote:
Hi all
In my controller I have code as below:
# app/controllers/bookings_controller.rb
@booking.unit_installments.each do |i|
InterestAmount.new(i, Date.today, project).calculate
end
I have seen `stub_chain` method but I didn't find how to stub
chain methods with arguments and how to verify chain methods with
arguments as well. Could you help me?
What are you trying to test/assert here?
At a first glance, I'd refactor InterestAmount to provide an interface
`InterestAmount.calculate`, then you don't need to use stub_chain, and
also hide your implementation.
Cheers,
Xavier
Thanks in advance.
--
You received this message because you are subscribed to the Google
Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/be2b852e-283d-4d80-99c3-c83604aa9513%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/52F1C84C.6000201%40xaviershay.com.
For more options, visit https://groups.google.com/groups/opt_out.