Sha256: 9f258b03438e5edc680d6756b1527bafe35f137f3a5b8b77057be9e0e367ea14

Contents?: true

Size: 1.06 KB

Versions: 20

Compression:

Stored size: 1.06 KB

Contents

describe "PM::Table utils" do

  before do
    @subject = TestTableScreen.new
    @subject.on_load
    @subject.update_table_data
  end

  it "should convert an index path to a section index" do
    index_path = NSIndexPath.indexPathForRow(12, inSection:2)
    given = {index_path: index_path}
    expected = {
      index_path: index_path,
      section: 2,
      index: 12
    }

    @subject.index_path_to_section_index(given).should == expected
  end

  it "return the original param when converting an index path with incorrect values" do
    @subject.index_path_to_section_index(17).should == 17
  end

  it "should properly determine if all members of an array are the same class" do
    @subject.array_all_members_of?([1, 2, 3, 4], Fixnum).should == true
    @subject.array_all_members_of?(["string", 'string2'], String).should == true
    @subject.array_all_members_of?([:sym1, :sym2, :sym3], Symbol).should == true

    @subject.array_all_members_of?([1, 2, 3, 4, 'String'], Fixnum).should == false
    @subject.array_all_members_of?([4.4, 2], Fixnum).should == false
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ProMotion-3.0.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.8.2 spec/unit/tables/table_utils_spec.rb
ProMotion-2.8.1 spec/unit/tables/table_utils_spec.rb
ProMotion-2.8.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.7.1 spec/unit/tables/table_utils_spec.rb
ProMotion-2.7.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.6.1 spec/unit/tables/table_utils_spec.rb
ProMotion-2.6.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.5.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.5.0.beta1 spec/unit/tables/table_utils_spec.rb
ProMotion-2.4.2 spec/unit/tables/table_utils_spec.rb
ProMotion-2.4.1 spec/unit/tables/table_utils_spec.rb
ProMotion-2.4.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.3.1 spec/unit/tables/table_utils_spec.rb
ProMotion-2.3.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.2.2 spec/unit/tables/table_utils_spec.rb
ProMotion-2.2.1 spec/unit/tables/table_utils_spec.rb
ProMotion-2.2.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.1.0 spec/unit/tables/table_utils_spec.rb
ProMotion-2.1.0.beta1 spec/unit/tables/table_utils_spec.rb