test/helper.rb in skim-0.8.6 vs test/helper.rb in skim-0.9.0

- old
+ new

@@ -1,9 +1,8 @@ require "rubygems" require "minitest/unit" require "minitest/reporters" -require "temple"; Temple::Filter # Trigger #13 require "skim" require "coffee_script" require "execjs" if ENV["RM_INFO"] || ENV["TEAMCITY_VERSION"] @@ -26,15 +25,15 @@ def setup @context = CoffeeScript.compile(context_source, :bare => true) end def context(options) - case context = options[:context] + case context = options.delete(:context) when String context when Hash - MultiJson.encode(context) + JSON.dump(context) else "new Context()" end end @@ -50,9 +49,10 @@ "var evaluate = function () { return template(context); }" ] if Skim::Engine.default_options[:use_asset] code.unshift skim_source end + context = ExecJS.compile(code.join(";")) context.call("evaluate") end def render(source, options = {})