Sha256: 2506b6cebd7e597f1f1759407e34e2922a587dc58714357009fc792e92de7e69

Contents?: true

Size: 734 Bytes

Versions: 6

Compression:

Stored size: 734 Bytes

Contents

describe "HTML contents" do

  it "uses last String value as content" do
    target %^<p>Hello</p>^

    actual do
      p { "Hello" }
    end
  end

  it "closes tag with :/" do
    target %^<p></p>^
    actual {
      p./
    }
  end

  it "does not give end-tags to void tags (self-closing tags)" do
    target %^<br />\n<img />^
    actual {
      br./
      img./
    }
  end

  it "escapes inner text" do
    target %^<p>&amp; here lies jack</p>^

    actual do
      p { "& here lies jack" }
    end
  end

  it "strips out W3C unallowed Unicode chars" do
    target %^<div>hello      hello</div>^
    actual do
      div { "hello \u0340\u0341\u17a3\u17d3\u2028\u2029 hello" }
    end
  end

end # === describe HTML contents

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
www_app-1.3.0 specs/server-side/0020-tag_content.rb
www_app-1.2.1 specs/server-side/0020-tag_content.rb
www_app-1.2.0 specs/server-side/0020-tag_content.rb
www_app-1.1.0 specs/server-side/0020-tag_content.rb
www_app-1.0.1 specs/as_ruby/0020-tag_content.rb
www_app-1.0.0 specs/as_ruby/0020-tag_content.rb