Skip to content

Instantly share code, notes, and snippets.

@davetron5000
Created August 1, 2014 16:20
Show Gist options
  • Save davetron5000/227e01f1f027f55ef89b to your computer and use it in GitHub Desktop.
Save davetron5000/227e01f1f027f55ef89b to your computer and use it in GitHub Desktop.
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