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-4.0.0 spec/ios/nsarray_spec.rb
sugarcube-3.5.0 spec/ios/nsarray_spec.rb
sugarcube-3.4.2 spec/ios/nsarray_spec.rb
sugarcube-3.4.1 spec/ios/nsarray_spec.rb
sugarcube-3.4.0 spec/ios/nsarray_spec.rb
sugarcube-3.3.7 spec/ios/nsarray_spec.rb
sugarcube-3.3.6 spec/ios/nsarray_spec.rb
sugarcube-3.3.5 spec/ios/nsarray_spec.rb
sugarcube-3.3.4 spec/ios/nsarray_spec.rb
sugarcube-3.3.3 spec/ios/nsarray_spec.rb
sugarcube-3.3.2 spec/ios/nsarray_spec.rb
sugarcube-3.3.1 spec/ios/nsarray_spec.rb
sugarcube-3.3.0 spec/ios/nsarray_spec.rb
sugarcube-3.2.0 spec/ios/nsarray_spec.rb
sugarcube-3.1.1 spec/ios/nsarray_spec.rb
sugarcube-3.1.0 spec/ios/nsarray_spec.rb
sugarcube-3.0.8 spec/ios/nsarray_spec.rb
sugarcube-3.0.7 spec/ios/nsarray_spec.rb
sugarcube-3.0.6 spec/ios/nsarray_spec.rb
sugarcube-3.0.5 spec/ios/nsarray_spec.rb