Sha256: 503ead07cebc7104611f41311c3364cd0a8a4f7c0653881bbfa43af7f02b72c9

Contents?: true

Size: 1.89 KB

Versions: 56

Compression:

Stored size: 1.89 KB

Contents

describe UITableViewCell do

  it 'should create a default cell' do
    cell = UITableViewCell.default('cell_identifier')
    UITableViewCell.should === cell
    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')
    UITableViewCell.should === cell
    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')
    UITableViewCell.should === cell
    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')
    UITableViewCell.should === cell
    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

56 entries across 56 versions & 1 rubygems

Version Path
sugarcube-1.0.2 spec/uitableviewcell_spec.rb
sugarcube-1.0.1 spec/uitableviewcell_spec.rb
sugarcube-1.0.0 spec/uitableviewcell_spec.rb
sugarcube-0.20.25 spec/uitableviewcell_spec.rb
sugarcube-0.20.24 spec/uitableviewcell_spec.rb
sugarcube-0.20.23 spec/uitableviewcell_spec.rb
sugarcube-0.20.22 spec/uitableviewcell_spec.rb
sugarcube-0.20.21 spec/uitableviewcell_spec.rb
sugarcube-0.20.20 spec/uitableviewcell_spec.rb
sugarcube-0.20.19 spec/uitableviewcell_spec.rb
sugarcube-0.20.18 spec/uitableviewcell_spec.rb
sugarcube-0.20.17 spec/uitableviewcell_spec.rb
sugarcube-0.20.16 spec/uitableviewcell_spec.rb
sugarcube-0.20.15 spec/uitableviewcell_spec.rb
sugarcube-0.20.13 spec/uitableviewcell_spec.rb
sugarcube-0.20.12 spec/uitableviewcell_spec.rb