Sha256: 0e1cd6a885cb42a36b704f77e14c1d1d08b510a41055ee3231ad580861e5669a

Contents?: true

Size: 831 Bytes

Versions: 11

Compression:

Stored size: 831 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

require 'v8/jasmine'

describe V8::Jasmine do

  it "cannot be included" do
    lambda {
      Class.new.send(:include, V8::Jasmine)
    }.should raise_error(ScriptError)
  end
  
  it "can only be used to extend V8::Context objecs" do
    lambda {
      V8::Context.new.extend(V8::Jasmine)
    }.should_not raise_error
    
    lambda {
      Object.new.extend(V8::Jasmine)
    }.should raise_error(ScriptError)
  end
  
  it "extends a bare context with the jasmine runtime" do
    V8::Context.new do |cxt|
      cxt.extend V8::Jasmine
      cxt['jasmine'].getEnv().should_not be_nil
    end
  end
end

describe V8::Jasmine::Context do
  
  it "comes pre-bundled with jasmine" do
    V8::Jasmine::Context.new do |cxt|
      cxt['jasmine'].should_not be_nil
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
therubyracer-0.8.0 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.8.0.pre3 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.8.0.pre2 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.8.0.pre spec/contrib/v8/jasmine_spec.rb
therubyracer-0.7.5 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.7.4 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.7.3 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.7.2 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.7.2.pre spec/contrib/v8/jasmine_spec.rb
therubyracer-0.7.1 spec/contrib/v8/jasmine_spec.rb
therubyracer-0.7.1.pre spec/contrib/v8/jasmine_spec.rb