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

sanity check for enumeration Object properties

This commit is contained in:
Charles Lowell 2012-05-18 09:49:44 -05:00
parent d3c9319357
commit 125a37a5d3

View file

@ -17,6 +17,19 @@ describe V8::C::Object do
o.Get(key).Utf8Value().should eql "bar" o.Get(key).Utf8Value().should eql "bar"
end end
end end
it "can retrieve all property names" do
V8::C::HandleScope() do
o = V8::C::Object::New()
{"foo" => "bar", "baz" => "bang"}.each do |key, value|
o.Set(V8::C::String::New(key), V8::C::String::New(value))
end
names = o.GetPropertyNames()
names.Length().should eql 2
names.Get(0).Utf8Value().should eql "foo"
names.Get(1).Utf8Value().should eql "baz"
end
end
it "can set an accessor from ruby" do it "can set an accessor from ruby" do
V8::C::HandleScope() do V8::C::HandleScope() do
o = V8::C::Object::New() o = V8::C::Object::New()