Sha256: 3696598608f9479f0777cfd94704a1f980c0c9be1c85a01e753ef9491bea8aeb

Contents?: true

Size: 857 Bytes

Versions: 14

Compression:

Stored size: 857 Bytes

Contents

describe "String" do
  describe "strip_heredoc" do
    it "should strip heredoc on an empty string" do
      ''.strip_heredoc.should == ''
    end

    it "should strip heredoc on a string with no lines" do
      'x'.strip_heredoc.should == 'x'
      '    x'.strip_heredoc.should == 'x'
    end

    it "should strip heredoc on a heredoc with no margin" do
      "foo\nbar".strip_heredoc.should == "foo\nbar"
      "foo\n  bar".strip_heredoc.should == "foo\n  bar"
    end

    it "should strip heredoc on a regular indented heredoc" do
      <<-EOS.strip_heredoc.should == "foo\n  bar\nbaz\n"
        foo
          bar
        baz
      EOS
    end

    it "should strip heredoc on a regular indented heredoc with blank lines" do
      <<-EOS.strip_heredoc.should == "foo\n  bar\n\nbaz\n"
        foo
          bar

        baz
      EOS
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
motion-support-1.2.1 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-1.1.1 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-1.2.0 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-1.1.0 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-1.0.0 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-0.3.0 spec/motion-support/core_ext/string/strip_spec.rb
motion_blender-support-0.2.8 spec/motion-support/core_ext/string/strip_spec.rb
motion_blender-support-0.2.7 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-0.2.6 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-0.2.5 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-0.2.4 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-0.2.3 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-0.2.2 spec/motion-support/core_ext/string/strip_spec.rb
motion-support-0.2.0 spec/motion-support/core_ext/string/strip_spec.rb