Created
March 20, 2010 16:56
-
-
Save dchelimsky/338767 to your computer and use it in GitHub Desktop.
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
describe Person do | |
context "walking on a rainy day" do | |
context "with an umbrella" do | |
it "stays dry" do | |
day = Day.new(:weather => Rain.new) | |
person = Person.new(:umbrella => Umbrella.new) | |
person.walk_on(day) | |
person.should be_dry | |
end | |
end | |
context "without an umbrella" do | |
it "gets wet" do | |
day = Day.new(:weather => Rain.new) | |
person = Person.new(:umbrella => nil) | |
person.walk_on(day) | |
person.should be_dry | |
end | |
end | |
end | |
end | |
describe Person do | |
context "walking on a rainy day" do | |
let(:rainy_day) { Day.new(:weather => Rain.new } | |
context "with an umbrella" do | |
it "stays dry" do | |
person = Person.new(:umbrella => Umbrella.new) | |
person.walk_on(rainy_day) | |
person.should be_dry | |
end | |
end | |
context "without an umbrella" do | |
it "gets wet" do | |
person = Person.new(:umbrella => nil) | |
person.walk_on(rainy_day) | |
person.should be_dry | |
end | |
end | |
end | |
end | |
describe Person do | |
before(:each) do | |
@person = Person.new | |
end | |
context "walking on a rainy day" do | |
before(:each) do | |
@day = Day.new(:weather => Rain.new) | |
end | |
context "with an umbrella" do | |
before(:each) do | |
@person.umbrella = Umbrella.new | |
end | |
it "stays dry" do | |
@person.walk_on(@day) | |
@person.should be_dry | |
end | |
end | |
context "without an umbrella" do | |
before(:each) do | |
@person.umbrella = nil | |
end | |
it "gets wet" do | |
@person.walk_on(@day) | |
@person.should be_dry | |
end | |
end | |
end | |
end | |
describe Person do | |
before(:each) do | |
@person = Person.new | |
end | |
context "with an umbrella" do | |
before(:each) do | |
@person.umbrella = Umbrella.new | |
end | |
context "walking on a rainy day" do | |
before(:each) do | |
@day = Day.new(:weather => Rain.new) | |
@person.walk_on(@day) | |
end | |
it "stays dry" do | |
@person.should be_dry | |
end | |
end | |
end | |
context "with an umbrella" do | |
before(:each) do | |
@person.umbrella = nil | |
end | |
context "walking on a rainy day" do | |
before(:each) do | |
@day = Day.new(:weather => Rain.new) | |
@person.walk_on(@day) | |
end | |
it "gets wet" do | |
@person.should be_dry | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment