Ruby - Testing with RSpec and Minitest
Identify the error in this test double usage and how to fix it:
order = double('order')
allow(order).to receive(:total)
puts order.totalIdentify the error in this test double usage and how to fix it:
order = double('order')
allow(order).to receive(:total)
puts order.totaltotal is allowed but no return value is set, so it returns nil.and_return(value) to specify what total should return.and_return causes order.total to return nil, fix by adding and_return -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions