Sha256: a832491723bca8e80ff4c3715fed97e386b0807dbdc2d83f4013635621e9cfd1

Contents?: true

Size: 720 Bytes

Versions: 19

Compression:

Stored size: 720 Bytes

Contents

require 'spec_helper'

RSpec.describe 'Multiline rendering', type: :render do
  it 'handles multiline syntax' do
    expect(render_string(<<HAML)).to eq("<p>\nfoo bar baz\nquux\n</p>\n")
%p
  = "foo " + |
    "bar " + |   
    "baz"               |
  = "quux"
HAML
  end

  it 'handles multiline with non-script line' do
    expect(render_string(<<HAML)).to eq("<p>\nfoo \nbar\n</p>\n")
%p
  foo |  
  bar
HAML
  end

  it 'handles multiline at the end of template' do
    expect(render_string(<<HAML)).to eq("<p>\nfoo  bar baz \n</p>\n")
%p
  foo  |
bar |
  baz |
HAML
  end

  it 'is not multiline' do
    expect(render_string(<<HAML)).to eq("<div>\nhello\n|\nworld\n</div>\n")
%div
  hello
  |
  world
HAML
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
faml-0.2.7 spec/render/multiline_spec.rb
faml-0.2.6 spec/render/multiline_spec.rb
faml-0.2.5 spec/render/multiline_spec.rb
faml-0.2.4 spec/render/multiline_spec.rb
faml-0.2.3 spec/render/multiline_spec.rb
faml-0.2.2 spec/render/multiline_spec.rb
faml-0.2.1 spec/render/multiline_spec.rb
faml-0.2.0 spec/render/multiline_spec.rb
fast_haml-0.1.10 spec/render/multiline_spec.rb
fast_haml-0.1.9 spec/render/multiline_spec.rb
fast_haml-0.1.8 spec/render/multiline_spec.rb
fast_haml-0.1.7 spec/render/multiline_spec.rb
fast_haml-0.1.6 spec/render/multiline_spec.rb
fast_haml-0.1.5 spec/render/multiline_spec.rb
fast_haml-0.1.4 spec/render/multiline_spec.rb
fast_haml-0.1.3 spec/render/multiline_spec.rb
fast_haml-0.1.2 spec/render/multiline_spec.rb
fast_haml-0.1.1 spec/render/multiline_spec.rb
fast_haml-0.1.0 spec/render/multiline_spec.rb