Sha256: c4a9adc8fccca49d9f629e58ec443490fe71276a6a6f81f16fba17a4c4117e0c

Contents?: true

Size: 966 Bytes

Versions: 1

Compression:

Stored size: 966 Bytes

Contents

require "spec_helper"
require "pricecut"

describe Pricecut::Elements::Li do
  describe "#output" do
    let(:visitor) { Pricecut::MarkdownVisitor.new }

    subject { described_class.new(visitor, root) }

    describe "when in an ordered list" do
      let(:root) do
        # We need to grab the first child to grab the <li>.
        parse(%<<ol><li>Ordered List<li></ol>>).children.first
      end

      it "appends a Markdown ordered list item with newline to the output" do
        subject.output!

        visitor.output.should eq("1.  Ordered List\n")
      end
    end

    describe "when in an unordered list" do
      let(:root) do
        # We need to grab the first child to grab the <li>.
        parse(%<<ul><li>Unordered List<li></ul>>).children.first
      end

      it "appends a Markdown ordered list item with newline to the output" do
        subject.output!

        visitor.output.should eq("-  Unordered List\n")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pricecut-0.0.2 spec/pricecut/elements/li_spec.rb