Skip to content

Commit

Permalink
Remove FULL_CONTEXT from spec_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Apr 7, 2013
1 parent 381c113 commit 73f2016
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion spec/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def path(*parts)
end

it "can pass through an already-compiled AST via compile/precompile" do
@context = Handlebars::Spec::FULL_CONTEXT
@context = Handlebars::Spec::CONTEXT

code = 'Handlebars.compile(new Handlebars.AST.ProgramNode([ new Handlebars.AST.ContentNode("Hello")]))();'
@context.eval(code).should == "Hello"
Expand Down
19 changes: 1 addition & 18 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def self.js_load(context, file)
end
CompilerContext["compileWithPartial"] = proc do |this, *args|
template, options = args[0], args[1] || nil
FULL_CONTEXT["Handlebars"]["compile"].call(template, options);
context["Handlebars"]["compile"].call(template, options);
end
end

Expand Down Expand Up @@ -116,23 +116,6 @@ def self.js_load(context, file)
end
end
end

FULL_CONTEXT = V8::Context.new
FULL_CONTEXT.instance_eval do |context|
Handlebars::Spec.load_helpers(context);

Handlebars::Spec.js_load(context, 'dist/handlebars.js');

context["Handlebars"]["logger"]["level"] = ENV["DEBUG_JS"] ? context["Handlebars"]["logger"][ENV["DEBUG_JS"]] : 4

context["Handlebars"]["logger"]["log"] = proc do |this, level, str|
logger_level = context["Handlebars"]["logger"]["level"].to_i

if logger_level <= level
puts str
end
end
end
end
end

Expand Down

0 comments on commit 73f2016

Please sign in to comment.