Sha256: 0f23a654c7f21a4dda4e6c365a41d4a55bf7ffd1f8c90378b469ab08e73f1fd2

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))

module PivotalToPdf
  module TextFormatters
    describe SimpleMarkup do
      describe "#output" do
        let(:formatter) {described_class.new "a text"}
        context "when there is no special formatting" do
          it "should return the string" do
            expect(formatter.output).to eq("a text")
          end
        end
        context "when there is bold special formatting" do
          let(:formatter) {described_class.new "a *special test* text"}
          it "should return the string converted" do
            expect(formatter.output).to eq("a <b>special test</b> text")
          end
        end
        context "when there is italic special formatting" do
          let(:formatter) {described_class.new "a _special test_ text"}
          it "should return the string converted" do
            expect(formatter.output).to eq("a <i>special test</i> text")
          end
        end
        context "when the text to format is nil" do
          let(:formatter) {described_class.new nil}
          it "should convert to an empty string" do
            expect(formatter.output).to be_empty
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pivotal_to_pdf-1.6.0 spec/pivotal_to_pdf/text_formatters/simple_markup_spec.rb
pivotal_to_pdf-1.4.0 spec/pivotal_to_pdf/text_formatters/simple_markup_spec.rb
pivotal_to_pdf-1.3.4 spec/pivotal_to_pdf/text_formatters/simple_markup_spec.rb
pivotal_to_pdf-1.3.3 spec/pivotal_to_pdf/text_formatters/simple_markup_spec.rb
pivotal_to_pdf-1.3.2 spec/pivotal_to_pdf/text_formatters/simple_markup_spec.rb