Created
August 6, 2008 01:06
-
-
Save ELLIOTTCABLE/4141 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
class Door | |
def self.awesome? | |
"FUCK YEAH!" | |
end | |
attr_accessor :color | |
def initialize | |
@color = :white | |
end | |
def paint color | |
@color = color | |
end | |
end |
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
require 'door' | |
describe Door do | |
it "should be fucking awesome" do | |
Door.should be_awesome | |
end | |
describe "painting" do | |
before(:each) do | |
@door = Door.new | |
end | |
it "should have a color" do | |
@door.color.should_not be_nil | |
end | |
it "should be paintable" do | |
@door.paint :red | |
@door.color.should == :red | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment