Sha256: 106510b82e63f0d3d80d20f2c1194faea00ef5fd3e0f58da3e47f2c6f8da65ef

Contents?: true

Size: 704 Bytes

Versions: 108

Compression:

Stored size: 704 Bytes

Contents

require 'helper'

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

  it 'should flatten nested multi expressions' do
    @filter.call([:multi,
      [:static, "a"],
      [:multi,
       [:dynamic, "aa"],
       [:multi,
        [:static, "aaa"],
        [:static, "aab"],
       ],
       [:dynamic, "ab"],
      ],
      [:static, "b"],
    ]).should.equal [:multi,
      [:static, "a"],
      [:dynamic, "aa"],
      [:static, "aaa"],
      [:static, "aab"],
      [:dynamic, "ab"],
      [:static, "b"],
    ]
  end

  it 'should return first element' do
    @filter.call([:multi, [:code, 'foo']]).should.equal [:code, 'foo']
  end
end

Version data entries

108 entries across 108 versions & 7 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/test/filters/test_multi_flattener.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/test/filters/test_multi_flattener.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/test/filters/test_multi_flattener.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/temple-0.8.2/test/filters/test_multi_flattener.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/temple-0.8.2/test/filters/test_multi_flattener.rb
temple-0.9.0 test/filters/test_multi_flattener.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/temple-0.8.0/test/filters/test_multi_flattener.rb
temple-0.8.2 test/filters/test_multi_flattener.rb
temple-0.8.1 test/filters/test_multi_flattener.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb
brakeman-3.7.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_multi_flattener.rb