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

24 lines
435 B
Ruby
Raw Normal View History

2015-04-05 10:40:55 +00:00
require 'c_spec_helper'
describe V8::C::Array do
requires_v8_context
it 'can store and retrieve a value' do
o = V8::C::Object::New(@isolate)
a = V8::C::Array::New(@isolate)
expect(a.Length).to eq 0
a.Set(0, o)
expect(a.Length).to eq 1
expect(a.Get(0).Equals(o)).to eq true
end
it 'can be initialized with a length' do
a = V8::C::Array::New(@isolate, 5)
expect(a.Length).to eq 5
end
end