Sha256: 3a3d1319002a914685d33693a09af78e0e88c3d2849cee80500a019663c77c62

Contents?: true

Size: 1.12 KB

Versions: 37

Compression:

Stored size: 1.12 KB

Contents

describe 'UIButton Layout and objc-style selectors' do

  before do
    @layout = TestButtonLayout.new
    @layout.view
  end

  it 'should set the title' do
    @layout.get(:button).currentTitle.should == TestButtonLayout::TITLE
  end

  it 'should set the highlighted title' do
    @layout.get(:button).titleForState(UIControlStateHighlighted).should == TestButtonLayout::HIGHLIGHTED_TITLE
  end

  it 'should set the image' do
    @layout.get(:button).currentImage.should == TestButtonLayout::IMAGE
  end

  it 'should set the highlighted image' do
    @layout.get(:button).imageForState(UIControlStateHighlighted).should == TestButtonLayout::HIGHLIGHTED_IMAGE
  end

  it 'should set the titleLabel font' do
    font = @layout.get(:button).titleLabel.font
    should_be_font = UIFont.fontWithName(TestButtonLayout::FONT, size: TestButtonLayout::SIZE)

    font.familyName.should == should_be_font.familyName
    font.pointSize.should == should_be_font.pointSize
  end

  it 'should set the titleLabel textAlignment' do
    alignment = @layout.get(:button).titleLabel.textAlignment
    alignment.should == NSTextAlignmentCenter
  end

end

Version data entries

37 entries across 31 versions & 1 rubygems

Version Path
motion-kit-1.1.1 spec/tvos/uibutton_layout_spec.rb
motion-kit-1.1.1 spec/ios/uibutton_layout_spec.rb
motion-kit-1.1.0 spec/tvos/uibutton_layout_spec.rb
motion-kit-1.1.0 spec/ios/uibutton_layout_spec.rb
motion-kit-1.0.3 spec/ios/uibutton_layout_spec.rb
motion-kit-1.0.3 spec/tvos/uibutton_layout_spec.rb
motion-kit-1.0.2 spec/tvos/uibutton_layout_spec.rb
motion-kit-1.0.2 spec/ios/uibutton_layout_spec.rb
motion-kit-1.0.1 spec/tvos/uibutton_layout_spec.rb
motion-kit-1.0.1 spec/ios/uibutton_layout_spec.rb
motion-kit-1.0.0 spec/ios/uibutton_layout_spec.rb
motion-kit-1.0.0 spec/tvos/uibutton_layout_spec.rb
motion-kit-0.18.0 spec/ios/uibutton_layout_spec.rb
motion-kit-0.17.0 spec/ios/uibutton_layout_spec.rb
motion-kit-0.16.0 spec/ios/uibutton_layout_spec.rb
motion-kit-0.15.0 spec/ios/uibutton_layout_spec.rb
motion-kit-0.14.2 spec/ios/uibutton_layout_spec.rb
motion-kit-0.14.1 spec/ios/uibutton_layout_spec.rb
motion-kit-0.14.0 spec/ios/uibutton_layout_spec.rb
motion-kit-0.13.0 spec/ios/uibutton_layout_spec.rb