Sha256: 13a012a4098fc0f93d7a43ed522e5ec1f1584cd29a1c2ab62e0ac05b0c8b3106

Contents?: true

Size: 1.57 KB

Versions: 42

Compression:

Stored size: 1.57 KB

Contents

describe 'Orientation helpers' do

  before do
    @layout = MK::Layout.new
  end

  it 'should have orientation helpers' do
    @layout.context({}) do
      @layout.orientation?(UIInterfaceOrientationPortrait).should == true
      @layout.orientation?(UIInterfaceOrientationLandscapeLeft).should == false
      @layout.orientation?(UIInterfaceOrientationLandscapeRight).should == false
      @layout.orientation?(UIInterfaceOrientationPortraitUpsideDown).should == false
    end
  end

  it 'should have orientation (portrait?) helpers' do
    @layout.context({}) do
      @layout.portrait?.should == true
      @layout.upright?.should == true
      @layout.upside_down?.should == false
      @layout.landscape?.should == false
      @layout.landscape_left?.should == false
      @layout.landscape_right?.should == false
    end
  end

  it 'should have orientation (portrait do end) helpers' do
    @layout.context({}) do
      @check = false
      @layout.portrait do
        @check = true
      end
      @check.should == true

      @check = false
      @layout.upright do
        @check = true
      end
      @check.should == true

      @check = false
      @layout.upside_down do
        @check = true
      end
      @check.should == false

      @check = false
      @layout.landscape do
        @check = true
      end
      @check.should == false

      @check = false
      @layout.landscape_left do
        @check = true
      end
      @check.should == false

      @check = false
      @layout.landscape_right do
        @check = true
      end
      @check.should == false
    end
  end

end

Version data entries

42 entries across 36 versions & 1 rubygems

Version Path
motion-kit-0.9.1 spec/ios/orientation_helper_specs.rb
motion-kit-0.9.0 spec/ios/orientation_helper_specs.rb