You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the scope of method stubs with a default scope is executed within the mocked type. This should be changed to execute in the scope of the spec.
structMyStructdefstubbed_method
answer
enddefanswer1endendSpectator.describe MyStructdo
let(answer) { 42 }
mock MyStructdo
stub stubbed_method { answer }
end
it "returns the answer"do
expect(subject.stubbed_method).to eq(42) # Fails, reports 1endend
Currently, the scope of method stubs with a default scope is executed within the mocked type. This should be changed to execute in the scope of the spec.
Issue originally raised in #14
The text was updated successfully, but these errors were encountered: