Sha256: 355e09d77d2b7caa4efb39073e72eb68cc15a1ffa8d2e6fd9cef7627c39c2eb9

Contents?: true

Size: 1.13 KB

Versions: 6

Compression:

Stored size: 1.13 KB

Contents

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pivotal_to_pdf-1.3.1 spec/pivotal_to_pdf/simple_text_formatter_spec.rb
pivotal_to_pdf-1.3.0 spec/pivotal_to_pdf/simple_text_formatter_spec.rb
pivotal_to_pdf-1.2.0 spec/pivotal_to_pdf/simple_text_formatter_spec.rb
pivotal_to_pdf-1.1.0 spec/pivotal_to_pdf/simple_text_formatter_spec.rb
pivotal_to_pdf-1.0.0 spec/pivotal_to_pdf/simple_text_formatter_spec.rb
pivotal_to_pdf-0.9.1 spec/pivotal_to_pdf/simple_text_formatter_spec.rb