Sha256: 471f6c5ea8ea01453a6a412353a2e30cc3505ed0b17edc2b895c809e5246cb82

Contents?: true

Size: 1.11 KB

Versions: 15

Compression:

Stored size: 1.11 KB

Contents

describe 'UIControl' do
  tests UIControlController

  before do
    controller.reset
  end

  it 'should have two buttons' do
    UIButton.should === controller.button1
    UIButton.should === controller.button2
  end

  it 'button1 should respond to touches' do
    controller.button1.sendActionsForControlEvents(:touch.uicontrolevent)
    controller.touched.should == controller.button1
    controller.touched_1.should == true
    controller.touched_count.should == 1
  end

  it 'button2 should respond to touches' do
    controller.button2.sendActionsForControlEvents(:touch.uicontrolevent)
    controller.touched.should == controller.button2
    controller.touched_2.should == true
    controller.touched_count.should == 1
  end

  it 'should be able to share handlers with arity 1 (sender)' do
    controller.button1.sendActionsForControlEvents(:touch.uicontrolevent)
    controller.button2.sendActionsForControlEvents(:touch.uicontrolevent)
    controller.touched.should == controller.button2
    controller.touched_1.should == true
    controller.touched_2.should == true
    controller.touched_count.should == 2
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sugarcube-0.20.12 spec/uicontrol_spec.rb
sugarcube-0.20.11 spec/uicontrol_spec.rb
sugarcube-0.20.10 spec/uicontrol_spec.rb
sugarcube-0.20.9 spec/uicontrol_spec.rb
sugarcube-0.20.8 spec/uicontrol_spec.rb
sugarcube-0.20.7 spec/uicontrol_spec.rb
sugarcube-0.20.6 spec/uicontrol_spec.rb
sugarcube-0.20.5 spec/uicontrol_spec.rb
sugarcube-0.20.4 spec/uicontrol_spec.rb
sugarcube-0.20.3 spec/uicontrol_spec.rb
sugarcube-0.20.1 spec/uicontrol_spec.rb
sugarcube-0.20.0 spec/uicontrol_spec.rb
sugarcube-0.19.5 spec/uicontrol_spec.rb
sugarcube-0.19.4 spec/uicontrol_spec.rb
sugarcube-0.19.2 spec/uicontrol_spec.rb