Sha256: d87dd04a674977ff05f233aa30ee9091e62bead05062e5c4197efa1b3649e474

Contents?: true

Size: 870 Bytes

Versions: 1

Compression:

Stored size: 870 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

  it 'can be used in attribute list' do
    expect(render_string(<<HAML)).to eq("<div bar='2' foo='1'></div>\n")
%div{foo: 1, |
  bar: 2}
HAML
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
faml-0.2.8 spec/render/multiline_spec.rb