Sha256: fd24e2a0eded9fe63a61b31c31d8ae4aa03fd0a9184f714182c5cfdb7783b91c

Contents?: true

Size: 1020 Bytes

Versions: 5

Compression:

Stored size: 1020 Bytes

Contents

require 'helper'

describe Temple::Filters::StaticMerger do
  before do
    @filter = Temple::Filters::StaticMerger.new
  end

  it 'should merge serveral statics' do
    @filter.compile([:multi,
      [:static, "Hello "],
      [:static, "World, "],
      [:static, "Good night"]
    ]).should.equal [:multi,
      [:static, "Hello World, Good night"]
    ]
  end

  it 'should merge serveral statics around block' do
    @filter.compile([:multi,
      [:static, "Hello "],
      [:static, "World!"],
      [:block, "123"],
      [:static, "Good night, "],
      [:static, "everybody"]
    ]).should.equal [:multi,
      [:static, "Hello World!"],
      [:block, "123"],
      [:static, "Good night, everybody"]
    ]
  end

  it 'should merge serveral statics across newlines' do
    @filter.compile([:multi,
      [:static, "Hello "],
      [:static, "World, "],
      [:newline],
      [:static, "Good night"]
    ]).should.equal [:multi,
      [:static, "Hello World, Good night"],
      [:newline]
    ]
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
temple-0.1.8 test/filters/test_static_merger.rb
temple-0.1.7 test/filters/test_static_merger.rb
temple-0.1.6 test/filters/test_static_merger.rb
temple-0.1.5 test/filters/test_static_merger.rb
temple-0.1.4 test/filters/test_static_merger.rb