Skip to content

Instantly share code, notes, and snippets.

@okitan
Created July 8, 2012 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okitan/3068836 to your computer and use it in GitHub Desktop.
Save okitan/3068836 to your computer and use it in GitHub Desktop.
named subject
describe "named subject" do
subject(:a) { "a" }
subject(:b) { "b" }
it { a.should == "a" }
it { b.should == "b" }
it { should == "a" }
it { subject.should == "a" }
end
__EOF__
F.FF
Failures:
1) named subject
Failure/Error: it { a.should == "a" }
expected: "a"
got: "b" (using ==)
# ./named_subject_spec.rb:9:in `block (2 levels) in <top (required)>'
2) named subject
Failure/Error: it { should == "a" }
expected: "a"
got: "b" (using ==)
# ./named_subject_spec.rb:11:in `block (2 levels) in <top (required)>'
3) named subject
Failure/Error: it { subject.should == "a" }
expected: "a"
got: "b" (using ==)
# ./named_subject_spec.rb:12:in `block (2 levels) in <top (required)>'
Finished in 0.00137 seconds
4 examples, 3 failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment