1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/spec/ext/cxt_spec.rb

25 lines
599 B
Ruby
Raw Normal View History

require "#{File.dirname(__FILE__)}/../spec_helper.rb"
include V8
describe C::Context do
it "should not have a current context if no context is open" do
2010-05-17 15:14:36 +03:00
C::Context::GetEntered().should be_nil
end
it "can determine if there is a current context" do
C::Context::InContext().should be(false)
C::Context.new.open do |cxt|
C::Context::InContext().should be(true)
end
end
it "returns the currently open context" do
C::Context.new.open do |cxt|
cxt.should be_eql(C::Context::GetEntered())
cxt.should == C::Context::GetEntered()
end
end
end