Sha256: a14e718166a6d78eecd4a2e01f2d5bd9adec1eaadabed374aa59d3db6ee64009
Contents?: true
Size: 1.03 KB
Versions: 2
Compression:
Stored size: 1.03 KB
Contents
# encoding: utf-8 class Nanoc::Filters::MustacheTest < Nanoc::TestCase 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.setup_and_run('The protagonist of {{title}} is {{protagonist}}.') assert_equal('The protagonist of Max Payne is Max Payne.', result) end end def test_filter_with_yield 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( { content: 'No Payne No Gayne', item: item }) # Run filter result = filter.setup_and_run('Max says: {{yield}}.') assert_equal('Max says: No Payne No Gayne.', result) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nanoc-3.8.0 | test/filters/test_mustache.rb |
nanoc-3.7.5 | test/filters/test_mustache.rb |