Sha256: 9de93481ee71890bff3c65a467164f6435e17a0135bfc64c31edde90bc052f7e

Contents?: true

Size: 1.92 KB

Versions: 54

Compression:

Stored size: 1.92 KB

Contents

describe UITableViewCell do

  it 'should create a default cell' do
    cell = UITableViewCell.default('cell_identifier')
    cell.should.be.kind_of(UITableViewCell)
    cell.reuseIdentifier.should == 'cell_identifier'
    # there's no way to test for the style :-/
  end

  it 'should create a value1 cell' do
    cell = UITableViewCell.value1('cell_identifier')
    cell.should.be.kind_of(UITableViewCell)
    cell.reuseIdentifier.should == 'cell_identifier'
    # there's no way to test for the style :-/
  end

  it 'should create a value2 cell' do
    cell = UITableViewCell.value2('cell_identifier')
    cell.should.be.kind_of(UITableViewCell)
    cell.reuseIdentifier.should == 'cell_identifier'
    # there's no way to test for the style :-/
  end

  it 'should create a subtitle cell' do
    cell = UITableViewCell.subtitle('cell_identifier')
    cell.should.be.kind_of(UITableViewCell)
    cell.reuseIdentifier.should == 'cell_identifier'
    # there's no way to test for the style :-/
  end

  it 'should accept options (image)' do
    cell = UITableViewCell.default('cell_identifier',
      accessory: :disclosure,
      selection: :blue,
      text: 'text',
      image: 'little_square',
      )
    cell.accessoryType.should == UITableViewCellAccessoryDisclosureIndicator
    cell.selectionStyle.should == UITableViewCellSelectionStyleBlue
    cell.textLabel.text.should == 'text'
    cell.imageView.image.should == 'little_square'.uiimage
  end

  it 'should accept options (detail)' do
    cell = UITableViewCell.value2('cell_identifier',
      accessory: :disclosure,
      selection: :blue,
      text: 'text',
      detail: 'detail text',
      )
    cell.accessoryType.should == UITableViewCellAccessoryDisclosureIndicator
    cell.selectionStyle.should == UITableViewCellSelectionStyleBlue
    cell.textLabel.text.should == 'text'
    cell.detailTextLabel.text.should == 'detail text'
  end

end

# accessory
# selection
# text
# image
# detail

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
sugarcube-4.0.0 spec/ios/uitableviewcell_spec.rb
sugarcube-3.5.0 spec/ios/uitableviewcell_spec.rb
sugarcube-3.4.2 spec/ios/uitableviewcell_spec.rb
sugarcube-3.4.1 spec/ios/uitableviewcell_spec.rb
sugarcube-3.4.0 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.7 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.6 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.5 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.4 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.3 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.2 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.1 spec/ios/uitableviewcell_spec.rb
sugarcube-3.3.0 spec/ios/uitableviewcell_spec.rb
sugarcube-3.2.0 spec/ios/uitableviewcell_spec.rb
sugarcube-3.1.1 spec/ios/uitableviewcell_spec.rb
sugarcube-3.1.0 spec/ios/uitableviewcell_spec.rb
sugarcube-3.0.8 spec/ios/uitableviewcell_spec.rb
sugarcube-3.0.7 spec/ios/uitableviewcell_spec.rb
sugarcube-3.0.6 spec/ios/uitableviewcell_spec.rb
sugarcube-3.0.5 spec/ios/uitableviewcell_spec.rb