Sha256: 6585db7532e496c2880c04c21a19e092815b60664fe16a772cfcbc40369444b9

Contents?: true

Size: 805 Bytes

Versions: 2

Compression:

Stored size: 805 Bytes

Contents

require 'helper'

class TestSkimTemplate < TestSkim
  def test_registered_extension
    assert_equal Skim::Template, Tilt['test.skim']
  end

  def test_sprockets_integration_without_asset
    compiled = ExecJS.compile(template_source)
    assert_equal "<p>Hello World, meet Skim</p>", compiled.eval("JST.test({name: 'Skim'})")
  end

  def test_sprockets_integration_with_asset
    Skim::Engine.default_options[:use_asset] = true
    compiled = ExecJS.compile(skim_source + ";" + template_source)
    assert_equal "<p>Hello World, meet Skim</p>", compiled.eval("JST.test({name: 'Skim'})")
  ensure
    Skim::Engine.default_options[:use_asset] = false
  end

  private
  def template_source
    env = Sprockets::Environment.new
    env.append_path File.dirname(__FILE__)
    env['test.js'].to_s
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
skim-0.8.4 test/test_skim_template.rb
skim-0.8.3 test/test_skim_template.rb