Created
November 13, 2012 22:03
-
-
Save rahearn/4068731 to your computer and use it in GitHub Desktop.
RSpec subject & let block load order example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context "outer" do | |
subject { puts "subject"; "subject" } | |
let(:expected) { puts "expected"; "subject" } | |
let!(:bang) { puts "bang"; "bang" } | |
context "inner" do | |
let!(:inner) { puts "inner"; "inner" } | |
it "should print bang, inner, test, subject, expected" do | |
puts "test" | |
subject.should == expected | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment