Sha256: 48c061f15c7c053fd04de5a92bcf538955b2db2ae51a50c708874ed8f0da5c28

Contents?: true

Size: 1008 Bytes

Versions: 52

Compression:

Stored size: 1008 Bytes

Contents

require 'helper'

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

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

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

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

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.7.4 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.7.3 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.7.2 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.7.1 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.7.0 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.9 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.8 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.7 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.6 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.5 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.4 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.3 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.2 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.1 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.6.0 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.5.17 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.5.16 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.5.15 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb
classiccms-0.5.14 vendor/bundle/gems/temple-0.4.0/test/filters/test_static_merger.rb