Sha256: 51d1d74c13253db7fad89a8b133bd81f05c4d3c19bed6a6f5e580e61bfee5d2b

Contents?: true

Size: 762 Bytes

Versions: 20

Compression:

Stored size: 762 Bytes

Contents

require 'test_helper'

module HandlebarsAssets
  class HamlbarsTest < ::Minitest::Test
    include SprocketsScope
    include CompilerSupport

    def compile_haml(source)
      (Haml::Engine.new(source, HandlebarsAssets::Config.haml_options).render).chomp
    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::HandlebarsTemplate.new(scope.pathname.to_s) { source }

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

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
handlebars_assets-0.23.9 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.8 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.7 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.6 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.5 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.4 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.3 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.2 test/handlebars_assets/hamlbars_test.rb
arcabouco-0.2.13 vendor/bundle/gems/handlebars_assets-0.23.1/test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.1 test/handlebars_assets/hamlbars_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/handlebars_assets-0.23.0/test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.23.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.22.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.21.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.20.2 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.20.1 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.20.0 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.19.2 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.19.1 test/handlebars_assets/hamlbars_test.rb
handlebars_assets-0.19 test/handlebars_assets/hamlbars_test.rb