Created
August 1, 2014 16:20
-
-
Save davetron5000/227e01f1f027f55ef89b 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 Person do | |
subject(:person) { Person.new(age: age) } | |
describe "minor?" do | |
context "over 18" do | |
let(:age) { 20 } | |
it { person.minor?.should == false } | |
end | |
context "under 18" do | |
let(:age) { 16 } | |
it { person.minor?.should == true } | |
end | |
context "exactly 18" do | |
let(:age) { 18 } | |
it { person.minor?.should == true }.because( | |
"Some obscure law in our client's district that requires treating 18 year olds as minors", | |
see: "http://jira.foo.com/SS-123245") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment