Ruby - Testing with RSpec and Minitest
Find the bug in this Ruby test double code snippet:
user = double('user')
allow(user).to receive(:email).and_return('test@example.com')
puts user.email_addressFind the bug in this Ruby test double code snippet:
user = double('user')
allow(user).to receive(:email).and_return('test@example.com')
puts user.email_addressemail is stubbed to return a string.user.email_address, which is not stubbed, so it raises an error.email_address is not stubbed, causing an error -> Option D15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions