Created
December 13, 2012 04:38
-
-
Save andrewpthorp/4274062 to your computer and use it in GitHub Desktop.
Give me your opinions:
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
# Explicit contexts | |
describe ".some_method?" do | |
context "when <condition is met>" do | |
it "should be true" do | |
@foo.condition = "met" | |
@foo.should be_some_method | |
end | |
end | |
context "when <condition is not met>" do | |
it "should be false" do | |
@foo.conditions = "not met" | |
@foo.should_not be_some_method | |
end | |
end | |
end | |
# Implicit contexts | |
describe ".some_method?" do | |
it "should be true when <condition is met>" do | |
@foo.conditions = "met" | |
@foo.should be_some_method | |
end | |
it "shoulbd be false when <condition is not met>" do | |
@foo.conditions = "not met" | |
@foo.should_not be_some_method | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tend to type out the contexts explicitly, but it seems heavy handed for these single test contexts.