Sha256: 7c5b40a167b098e95bf40711a2775470e8a62507dec7cc33fed014d3594c102f

Contents?: true

Size: 930 Bytes

Versions: 6

Compression:

Stored size: 930 Bytes

Contents

require "spec_helper"
include Nanoc::Toolbox::Helpers::HtmlTag

describe Nanoc::Toolbox::Helpers::HtmlTag do
  it { should respond_to(:tag) }
  it { should respond_to(:content_tag) }

  describe "#tag" do
    it "returns an simple self-closing tag by default" do
      tag("br").should == "<br />"
    end
    
    it "returns an simple self-closing tag with option" do
      tag("hr", :class => "thin").should == %[<hr class="thin" />]
    end

    it "returns an orphean tag when open is set to true" do
      tag("hr", {:class => "thin"}, true).should == %[<hr class="thin">]
    end
  end
  
  describe "#content_tag" do
    it "returns an simple with content tag by default" do
      content_tag("b", "Hello").should == "<b>Hello</b>"
    end
    
    it "returns an simple with content tag with options" do
      content_tag("b", "Hello", :class => "highlight").should == %[<b class="highlight">Hello</b>]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nanoc-toolbox-0.2.1 spec/helpers/html_tag_spec.rb
nanoc-toolbox-0.2.0 spec/helpers/html_tag_spec.rb
nanoc-toolbox-0.1.3 spec/helpers/html_tag_spec.rb
nanoc-toolbox-0.1.2 spec/helpers/html_tag_spec.rb
nanoc-toolbox-0.1.1 spec/helpers/html_tag_spec.rb
nanoc-toolbox-0.1.0 spec/helpers/html_tag_spec.rb