Last active
August 29, 2015 14:14
-
-
Save squarism/0bbdd2731fbf72605a9f to your computer and use it in GitHub Desktop.
Hi spec
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
# I know what you are saying about the composition. | |
# I know that this simple example doesn't represent the | |
# composability that you probably trying to do. | |
# But this is how I would do what you want. | |
# You already know all this so I'm wasting your time actually. | |
# => | |
# hi! | |
# hi! | |
# hello! | |
# hi! | |
describe "something" do | |
def hi | |
puts "hi!" | |
end | |
context "hi upfront" do | |
before do | |
hi | |
end | |
it "works" do | |
expect(10).to eq(helper) | |
end | |
it "really works" do | |
expect(11).to eq(helper) | |
end | |
end | |
context "hello before hi" do | |
before do | |
puts "hello!" | |
hi | |
end | |
it "really really works" do | |
expect(11).to eq(helper) | |
end | |
end | |
def helper | |
11 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment