Created
April 8, 2011 20:41
-
-
Save kblake/910690 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
# Write the tag class and the methods to make the specs pass | |
describe Tag do | |
def tag(name, options = {}) | |
Tag.new(name, options).show | |
end | |
it "instantiate itself" do | |
Tag.new(:p).should_not be_nil | |
end | |
it "accept a tag and generate" do | |
tag(:p).should == "<p></p>" | |
end | |
it "have content" do | |
tag(:p, :content => "Hello World!").should == "<p>Hello World!</p>" | |
end | |
it "one attribute" do | |
tag(:p, :content => "hello again", :class => "fun").should == "<p class='fun'>hello again</p>" | |
end | |
it "multiple attributes" do | |
tag(:p, :content => "hello again", :class => "fun", :id => "unique").should == "<p class='fun' id='unique'>hello again</p>" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment