"Use subject" #6
glaucocustodio
started this conversation in
General
Replies: 1 comment 1 reply
-
|
I think this bit describe '#add' do
it 'sums two numbers' do
subject = described_class.new(5)
expect(subject.add(1, 2)).to eq(8)
end
endshould be describe '#add' do
subject { described_class.new(5) }
it 'sums two numbers' do
expect(subject.add(1, 2)).to eq(8)
end
endto follow the RSpec docs on explicit subjects. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What are your thoughts on https://evenbetterspecs.github.io/#use-subject?
Beta Was this translation helpful? Give feedback.
All reactions