Created
August 20, 2013 22:09
-
-
Save jeremywrowe/6287993 to your computer and use it in GitHub Desktop.
This file contains 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
describe Wombat do | |
let(:active_user) do | |
user = User.new | |
user.tap(&:make_active) | |
end | |
context "with an active user" do | |
it "is a cuddly creator" do | |
expect(Wombat.new(active_user)).to be_cuddly | |
end | |
end | |
context "with an active overriden user" do | |
let(:active_user) do | |
# we do something here to override the global active user | |
# and since it isn't 'fetched' until you call upon it | |
# this one will be used instead of the one in the outer | |
# block. | |
end | |
it "is a cuddly creator" do | |
# until active_user is hit in the next line it is not created | |
expect(Wombat.new(active_user)).to be_cuddly | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment