Sha256: 1cdb9ccfdce7dbc791bbc1d9d9246b32e86da82ad6c87545ebca9777cf4774bb

Contents?: true

Size: 754 Bytes

Versions: 15

Compression:

Stored size: 754 Bytes

Contents

require 'test_helper'

module HandlebarsAssets
  class HamlbarsTest < Test::Unit::TestCase
    include SprocketsScope
    include CompilerSupport

    def compile_haml(source)
      Haml::Engine.new(source, HandlebarsAssets::Config.haml_options).render
    end

    def teardown
      HandlebarsAssets::Config.reset!
      HandlebarsAssets::Handlebars.reset!
    end

    def test_render_haml
      root = '/myapp/app/assets/templates'
      file = 'test_render.hamlbars'
      scope = make_scope root, file
      source = "%p This is {{handlebars}}"

      template = HandlebarsAssets::TiltHandlebars.new(scope.pathname.to_s) { source }

      assert_equal hbs_compiled('test_render', compile_haml(source)), template.render(scope, {})
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
handlebars_assets-0.16 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.15 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.14.1 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.13.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.12.3 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.12.2 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.12.1 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.12.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.11.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.10.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.9.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.8.2 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.8.1 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.8.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.7.2 test/handlebars_assets/hamlbars_test.rb