describe FashionSituation do it "should be inappropriate at a restaurant" do situation = FashionSituation.new(:shirt => false, :shoes => false, :shorts => true, :location => "restaurant") situation.should_not be_appropriate end it "should be inappropriate at work" do situation = FashionSituation.new(:shirt => false, :shoes => false, :shorts => true, :location => "work") situation.should_not be_appropriate end it "should be appropriate at the beach" do situation = FashionSituation.new(:shirt => false, :shoes => false, :shorts => true, :location => "beach") situation.should be_appropriate end end #### OR making this slightly more realistic, and talking about valid versus invalid # that actually is a case where I think having shared setup between tests is appropriate, because your tests really are really only valuable as a whole. a single one doesn't really prove anything describe FashionSituation do before { @situation = FashionSituation.new(:shirt => false, :shoes => false, :shorts => true, :location => "beach") } it "should be invalid at a restaurant" do @situation.location = 'restaurant' situation.should_not be_valid end it "should be invalid at work" do @situation.location = 'work' situation.should_not be_valid end it "should be valid when setup properly" do @situation.should be_valid end end # Though, generally with these you could just have describe FashionSituation do it "should be invalid at a restaurant" do Factory.build(:fashion_situation, :location => 'restaurant').should_not be_valid end it "should be invalid at work" do Factory.build(:fashion_situation, :location => 'work').should_not be_valid end it "should be valid when setup properly" do Factory.build(:fashion_situation, :location => 'beach').should be_valid end end # not 100% sure which of these 2 I prefer, but I think the one with the before is more obvious and involves less hoops