Sha256: b4e6897ca4f824defdb8d22c6627ea3d966d36fa2dc3838885bfeb29b22d6f40

Contents?: true

Size: 866 Bytes

Versions: 12

Compression:

Stored size: 866 Bytes

Contents

require 'test_helper'

module HandlebarsAssets
  class CompilingTest < Test::Unit::TestCase

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

    def test_custom_handlebars
      source = "This is {{handlebars}}"

      HandlebarsAssets::Config.compiler_path = File.expand_path '../../edge', __FILE__

      compiled = Handlebars.precompile(source, HandlebarsAssets::Config.options)
      assert_match /PRECOMPILE CALLED/, compiled
    end

    def test_patching_handlebars
      source = "This is {{nested.handlebars}}"

      HandlebarsAssets::Config.patch_path = File.expand_path '../../patch', __FILE__
      HandlebarsAssets::Config.patch_files = ['patch.js']

      compiled = Handlebars.precompile(source, HandlebarsAssets::Config.options)
      assert_match /CALLED PATCH/, compiled
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
handlebars_assets-0.18 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.17.2 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.17.1 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.17 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.16 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.15 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.14.1 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.13.0 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.12.3 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.12.2 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.12.1 test/handlebars_assets/compiling_test.rb
handlebars_assets-0.12.0 test/handlebars_assets/compiling_test.rb