Sha256: ec5baa9f33cde0264b08e10d78211f0c8ca08d0268fc0abbaeab4de048c174b3

Contents?: true

Size: 775 Bytes

Versions: 2

Compression:

Stored size: 775 Bytes

Contents

require 'test_helper'

module HoganAssets
  class TiltTest < Test::Unit::TestCase
    def test_mime_type
      assert_equal 'application/javascript', HoganAssets::Tilt.default_mime_type
    end

    def test_render
      scope = Class.new do
        def logical_path ; 'path/to/template' ; end
      end.new

      template = HoganAssets::Tilt.new('/myapp/app/assets/templates/path/to/template.mustache') { "This is {{mustache}}" }
      assert_equal <<-END_EXPECTED, template.render(scope, {})
        this.HoganTemplates || (this.HoganTemplates = {});
        this.HoganTemplates[\"path/to/template\"] = new Hogan.Template(function(c,p,i){var _=this;_.b(i=i||\"\");_.b(\"This is \");_.b(_.v(_.f(\"mustache\",c,p,0)));return _.fl();;});
      END_EXPECTED
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hogan_assets-1.0.3 test/hogan_assets/tilt_test.rb
hogan_assets-1.0.2 test/hogan_assets/tilt_test.rb