mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-21 19:43:03 +08:00
18 lines
527 B
Ruby
18 lines
527 B
Ruby
describe "NSValue objects" do
|
|
it "can be created manually" do
|
|
s = MyStruct4C.new(1, 2, 3, 4)
|
|
pointer = Pointer.new(MyStruct4C.type)
|
|
pointer[0] = s
|
|
val = NSValue.value(pointer, withObjCType:MyStruct4C.type)
|
|
TestMethod.testMethodAcceptingMyStruct4CValue(val).should == true
|
|
end
|
|
|
|
=begin
|
|
it "can be created from Boxed#to_value" do
|
|
val = MyStruct4C.new(1, 2, 3, 4).to_value
|
|
val.objcType.should == MyStruct4C.type
|
|
TestMethod.testMethodAcceptingMyStruct4CValue(val).should == true
|
|
end
|
|
=end
|
|
end
|