Sha256: e536e45ca384e147df813cbf30ff4e546b55b1f6e16644e1a327eea7fc06a575

Contents?: true

Size: 603 Bytes

Versions: 8

Compression:

Stored size: 603 Bytes

Contents

# encoding: utf-8

class Nanoc::Filters::MustacheTest < MiniTest::Unit::TestCase

  include Nanoc::TestHelpers

  def test_filter
    if_have 'mustache' do
      # Create item
      item = Nanoc::Item.new(
        'content',
        { :title => 'Max Payne', :protagonist => 'Max Payne' },
        '/games/max-payne/'
      )

      # Create filter
      filter = ::Nanoc::Filters::Mustache.new({ :item => item })

      # Run filter
      result = filter.run('The protagonist of {{title}} is {{protagonist}}.')
      assert_equal('The protagonist of Max Payne is Max Payne.', result)
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc-3.3.7 test/filters/test_mustache.rb
nanoc-3.3.6 test/filters/test_mustache.rb
nanoc-3.3.5 test/filters/test_mustache.rb
nanoc-3.3.4 test/filters/test_mustache.rb
nanoc-3.3.3 test/filters/test_mustache.rb
nanoc-3.3.2 test/filters/test_mustache.rb
nanoc-3.3.1 test/filters/test_mustache.rb
nanoc-3.3.0 test/filters/test_mustache.rb