Sha256: 2c7702c72c914aa526f70d7241645e4edc2fc333c94492f46bec14f1dc35ba0f

Contents?: true

Size: 898 Bytes

Versions: 59

Compression:

Stored size: 898 Bytes

Contents

describe "NSArray" do

  it "should have a method #to_pointer" do
    pointer = [1,2,3].to_pointer(:int)
    pointer.should != nil
    pointer[0].should == 1
    pointer[1].should == 2
    pointer[2].should == 3
  end

  it "should have a method #nsindexpath" do
    path = [0,1,2,3].nsindexpath
    path.length.should == 4
    path.indexAtPosition(0).should == 0
    path.indexAtPosition(1).should == 1
    path.indexAtPosition(2).should == 2
    path.indexAtPosition(3).should == 3
  end

  it "should have a method #nsindexset" do
    set = [0,1,2,3].nsindexset
    set.count.should == 4
    set.containsIndex(0).should == true
    set.containsIndex(1).should == true
    set.containsIndex(2).should == true
    set.containsIndex(3).should == true
    set.containsIndex(4).should == false
  end

  it "should have a method #nsset" do
    set = [0,1,0].nsset
    set.count.should == 2
  end

end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
sugarcube-3.0.4 spec/ios/nsarray_spec.rb
sugarcube-3.0.3 spec/ios/nsarray_spec.rb
sugarcube-3.0.2 spec/ios/nsarray_spec.rb
sugarcube-3.0.1 spec/ios/nsarray_spec.rb
sugarcube-3.0.0 spec/ios/nsarray_spec.rb
sugarcube-2.12.3 spec/ios/nsarray_spec.rb
sugarcube-2.12.2 spec/ios/nsarray_spec.rb
sugarcube-2.12.1 spec/ios/nsarray_spec.rb
sugarcube-2.12.0 spec/ios/nsarray_spec.rb
sugarcube-2.11.1 spec/ios/nsarray_spec.rb
sugarcube-2.11.0 spec/ios/nsarray_spec.rb
sugarcube-2.10.0 spec/ios/nsarray_spec.rb
sugarcube-2.9.1 spec/ios/nsarray_spec.rb
sugarcube-2.8.2 spec/ios/nsarray_spec.rb
sugarcube-2.8.1 spec/ios/nsarray_spec.rb
sugarcube-2.8.0 spec/ios/nsarray_spec.rb
sugarcube-2.7.1 spec/ios/nsarray_spec.rb
sugarcube-2.7.0 spec/ios/nsarray_spec.rb
sugarcube-2.6.0 spec/ios/nsarray_spec.rb
sugarcube-2.5.0 spec/ios/nsarray_spec.rb