Sha256: a77ae8f9f2a8a5674528a0929b20df50e23aab63c89cf368f5230eb7b149895d

Contents?: true

Size: 810 Bytes

Versions: 1

Compression:

Stored size: 810 Bytes

Contents

require "spec_helper"
require "pricecut"

describe Pricecut::Elements::Li do
  describe "#output" do
    let(:visitor) { Pricecut::MarkdownVisitor.new }
    let(:root) { parse(%<<li>List item<li>>) }

    subject { described_class.new(visitor, root) }

    describe "when in an ordered list" do
      before { subject.stub(:ordered_list?) { true } }

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

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

    describe "when in an unordered list" do
      before { subject.stub(:ordered_list?) { false } }

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

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