Sha256: 5c5a0b9db87c92196c86e62429f0c9f50b909ec7402768b75c64539ede49dde6

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

require File.join(File.dirname(__FILE__), %w[ .. .. spec_helper])

describe 'content formatter' do
  before do
    @formatter = Roart::ContentFormatter
  end

  describe 'formatting strings' do
    it "should remove \\r characters" do
      @formatter.format_string("a\r\ntext with\ndifferent\rnew\r\nlines").should_not include("\r")
    end

    it "should pad new lines with 2 spaces" do
      @formatter.format_string("a\ntext with\n\ndifferent\nnew\n  \nlines").should == "a\n" +
                                                                                      "  text with\n" +
                                                                                      "  \n" +
                                                                                      "  different\n" +
                                                                                      "  new\n" +
                                                                                      "    \n" +
                                                                                      "  lines"
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ludo-roart-0.1.19 spec/roart/core/content_formatter_spec.rb
ludo-roart-0.1.18 spec/roart/core/content_formatter_spec.rb
ludo-roart-0.1.17 spec/roart/core/content_formatter_spec.rb
ludo-roart-0.1.16 spec/roart/core/content_formatter_spec.rb
ludo-roart-0.1.15 spec/roart/core/content_formatter_spec.rb
roart-0.1.10 spec/roart/core/content_formatter_spec.rb