upgrade rspec

This commit is contained in:
Charles Lowell 2015-04-08 16:59:00 -05:00
parent e854a2f3aa
commit 292b053a64
8 changed files with 32 additions and 31 deletions

15
Gemfile
View File

@ -2,10 +2,11 @@ source 'http://rubygems.org'
gemspec
gem "rubysl", :platforms => :rbx
gem 'redjs', :git => 'https://github.com/cowboyd/redjs.git'
gem "rake"
gem "rspec", "~> 2.0"
gem "rake-compiler"
gem "gem-compiler", :platforms => :mri
group :development do
gem "rubysl", :platforms => :rbx
gem 'redjs', :git => 'https://github.com/cowboyd/redjs.git'
gem "rake"
gem "rspec", "~> 2.0"
gem "rake-compiler"
gem "gem-compiler", :platforms => :mri
end

View File

@ -9,7 +9,7 @@ describe V8::C::Array do
a.Length().should eql 0
a.Set(0, o)
a.Length().should eql 1
a.Get(0).Equals(o).should be_true
a.Get(0).Equals(o).should be_truthy
end
it "can be initialized with a length" do

View File

@ -2,14 +2,14 @@ require 'spec_helper'
describe V8::C::Locker do
it "can lock and unlock the VM" do
V8::C::Locker::IsLocked().should be_false
V8::C::Locker::IsLocked().should be_falsey
V8::C::Locker() do
V8::C::Locker::IsLocked().should be_true
V8::C::Locker::IsLocked().should be_truthy
V8::C::Unlocker() do
V8::C::Locker::IsLocked().should be_false
V8::C::Locker::IsLocked().should be_falsey
end
end
V8::C::Locker::IsLocked().should be_false
V8::C::Locker::IsLocked().should be_falsey
end
it "properly unlocks if an exception is thrown inside a lock block" do
@ -18,7 +18,7 @@ describe V8::C::Locker do
raise "boom!"
end
rescue
V8::C::Locker::IsLocked().should be_false
V8::C::Locker::IsLocked().should be_falsey
end
end
@ -29,7 +29,7 @@ describe V8::C::Locker do
raise "boom!"
end
rescue
V8::C::Locker::IsLocked().should be_true
V8::C::Locker::IsLocked().should be_truthy
end
end
end

View File

@ -26,8 +26,8 @@ describe V8::C::Object do
callback_data = V8::C::String::New("I am Legend")
left = V8::C::String::New("Yo! ")
getter = proc do |name, info|
info.This().StrictEquals(o).should be_true
info.Holder().StrictEquals(o).should be_true
info.This().StrictEquals(o).should be_truthy
info.Holder().StrictEquals(o).should be_truthy
V8::C::String::Concat(left, info.Data())
end
setter = proc do |name, value, info|

View File

@ -17,7 +17,7 @@ describe V8::C::Script do
name = V8::C::String::New("<spec>")
origin = V8::C::ScriptOrigin.new(name)
data = V8::C::ScriptData::PreCompile(source, source.length)
data.HasError().should be_false
data.HasError().should be_falsey
script = V8::C::Script::New(V8::C::String::New(source), origin, data)
script.Run().should eql 42
end
@ -25,6 +25,6 @@ describe V8::C::Script do
it "can detect errors in the script data" do
source = "^ = ;"
data = V8::C::ScriptData::PreCompile(source, source.length)
data.HasError().should be_true
data.HasError().should be_truthy
end
end

View File

@ -6,7 +6,7 @@ describe V8::C::Template do
describe V8::C::FunctionTemplate do
it "can be created with no arguments" do
t = V8::C::FunctionTemplate::New()
t.GetFunction().Call(@cxt.Global(),[]).StrictEquals(@cxt.Global()).should be_true
t.GetFunction().Call(@cxt.Global(),[]).StrictEquals(@cxt.Global()).should be_truthy
end
it "can be created with a callback" do
@ -16,10 +16,10 @@ describe V8::C::Template do
arguments.Length().should be(2)
arguments[0].Utf8Value().should eql 'one'
arguments[1].Utf8Value().should eql 'two'
arguments.Callee().StrictEquals(f).should be_true
arguments.This().StrictEquals(receiver).should be_true
arguments.Holder().StrictEquals(receiver).should be_true
arguments.IsConstructCall().should be_false
arguments.Callee().StrictEquals(f).should be_truthy
arguments.This().StrictEquals(receiver).should be_truthy
arguments.Holder().StrictEquals(receiver).should be_truthy
arguments.IsConstructCall().should be_falsey
arguments.Data().Value().should be(42)
V8::C::String::New("result")
end

View File

@ -24,11 +24,11 @@ describe V8::C::External do
filename = V8::C::String::New("<eval>")
script = V8::C::Script::New(source, filename)
result = script.Run()
trycatch.HasCaught().should be_true
trycatch.CanContinue().should be_true
trycatch.HasCaught().should be_truthy
trycatch.CanContinue().should be_truthy
exception = trycatch.Exception()
exception.should_not be_nil
exception.IsNativeError().should be_true
exception.IsNativeError().should be_truthy
trycatch.StackTrace().Utf8Value().should match /boom.*three.*two.*one/m
message = trycatch.Message();
message.should_not be_nil
@ -44,9 +44,9 @@ describe V8::C::External do
frame.GetColumn().should eql 15
frame.GetScriptName().Utf8Value().should eql "<eval>"
frame.GetScriptNameOrSourceURL().Utf8Value().should eql "<eval>"
frame.IsEval().should be_false
stack.GetFrame(4).IsEval().should be_true
frame.IsConstructor().should be_false
frame.IsEval().should be_falsey
stack.GetFrame(4).IsEval().should be_truthy
frame.IsConstructor().should be_falsey
end
end
end

View File

@ -5,6 +5,6 @@ module RedJS
Error = V8::Error
end
describe V8::Context do
pending "not ready for prime-time"
skip "not ready for prime-time"
#it_behaves_like 'RedJS::Context'
end
end