Sha256: a96184aa4913ea6bfc28d555541bf2a20c99519062bf8d3145784f7095b0a6bd

Contents?: true

Size: 1.48 KB

Versions: 20

Compression:

Stored size: 1.48 KB

Contents

describe "MotionLayout" do
  tests MotionLayoutController

  describe 'applied constraints' do
    it 'should have label1 on the left' do
      label1_left = CGRectGetMinX(controller.label1.frame)
      label1_left.should == 20
    end

    it 'should have label1 at the top' do
      label1_top = CGRectGetMinY(controller.label1.frame)
      label1_top.should == 100
    end

    it 'should have label2 at the top' do
      label2_top = CGRectGetMinY(controller.label2.frame)
      label2_top.should == 100
    end

    it 'should have margin between label1 and label2' do
      label1_right = CGRectGetMaxX(controller.label1.frame)
      label2_left = CGRectGetMinX(controller.label2.frame)
      (label2_left - label1_right).should == 20
    end

    it 'should have label2 and label3 on the right' do
      label2_right = CGRectGetMaxX(controller.label2.frame)
      label3_right = CGRectGetMaxX(controller.label3.frame)
      label3_right.should == label2_right
    end

    it 'should have label3 on the left' do
      label3_left = CGRectGetMinX(controller.label3.frame)
      label3_left.should == 20
    end

    it 'should have label3 at 220' do
      label3_top = CGRectGetMinY(controller.label3.frame)
      label3_top.should == 220
    end

    it 'should have label4 at 320' do
      frame = controller.container.label4.frame
      frame = controller.container.convertRect(frame, toView: controller.view)
      label4_top = CGRectGetMinY(frame)
      label4_top.should == 320
    end


  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
teacup-3.0.1 spec/ios/motion_layout_spec.rb
teacup-3.0.0 spec/ios/motion_layout_spec.rb
teacup-2.3.0 spec/ios/motion_layout_spec.rb
teacup-2.2.2 spec/ios/motion_layout_spec.rb
teacup-2.2.0 spec/ios/motion_layout_spec.rb
teacup-2.1.16 spec/ios/motion_layout_spec.rb
teacup-2.1.15 spec/ios/motion_layout_spec.rb
teacup-2.1.14 spec/ios/motion_layout_spec.rb
teacup-2.1.13 spec/ios/motion_layout_spec.rb
teacup-2.1.12 spec/ios/motion_layout_spec.rb
teacup-2.1.11 spec/ios/motion_layout_spec.rb
teacup-2.1.10 spec/ios/motion_layout_spec.rb
teacup-2.1.9 spec/ios/motion_layout_spec.rb
teacup-2.1.8 spec/ios/motion_layout_spec.rb
teacup-2.1.7 spec/ios/motion_layout_spec.rb
teacup-2.1.6 spec/ios/motion_layout_spec.rb
teacup-2.1.5 spec/ios/motion_layout_spec.rb
teacup-2.1.4 spec/ios/motion_layout_spec.rb
teacup-2.1.3 spec/ios/motion_layout_spec.rb
teacup-2.1.2 spec/ios/motion_layout_spec.rb