Sha256: 556ec37a404a66e2cafb8007783e2810cd56bd099f57393e15f882db586a1eed

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

Contents

require "pricecut"

describe Pricecut do
  describe ".parse" do
    it "parses HTML into Markdown" do
      html = <<-HTML.unindent
        <h1>H1</h1>
        <h2>H2</h2>
        <h3>H3</h3>
        <h4>H4</h4>
        <h5>H5</h5>
        <h6>H6</h6>

        <p>Paragraph</p>

        <ol><li>This is an ordered list.</li></ol>

        <ul><li>This is an unordered list.</li></ul>

        <p><em>This is emphasized.</em></p>
        <p><i>This is italic.</em></p>

        <p><strong>This is strong.</strong></p>
        <p><b>This is bold.</b></p>

        <blockquote><p>This is a blockquote.</p></blockquote>

        <p><img alt="Image" src="image.png" /></p>

        <p><a href="http://example.com">Example</a></p>
     HTML

      Pricecut.parse(html).should eq <<-MARKDOWN.unindent
        # H1 #
        ## H2 ##
        ### H3 ###
        #### H4 ####
        ##### H5 #####
        ###### H6 ######
        Paragraph

        1.  This is an ordered list.


        -  This is an unordered list.

        _This is emphasized._
        _This is italic._
        **This is strong.**
        **This is bold.**
        > This is a blockquote.
        ![Image](image.png)
        [Example](http://example.com)
      MARKDOWN
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pricecut-0.0.3 spec/pricecut/pricecut_spec.rb
pricecut-0.0.2 spec/pricecut/pricecut_spec.rb