For this test:
describe "can translate" do
let(:from){592}
it @from do
expect(Translator.three_digits(from)).to eq 'five hundred ninety two'
end
end
I need to refer to from
as @from
when using it in the it
statement but as just from
when using it in the expect
test. In each case trying to use the other format raises errors as unknown. Why the difference?
Does it reflect something I'm not doing/understanding correctly?
After more digging I realized the @ instance variable isn't working correctly - it just isn't reporting an error because an @variable can be empty. However if the tests fails and the test text descriptions is output the value for that variable is blank.