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-1.1.1 spec/tvos/orientation_helper_specs.rb
motion-kit-1.1.1 spec/ios/orientation_helper_specs.rb
motion-kit-1.1.0 spec/tvos/orientation_helper_specs.rb
motion-kit-1.1.0 spec/ios/orientation_helper_specs.rb
motion-kit-1.0.3 spec/tvos/orientation_helper_specs.rb
motion-kit-1.0.3 spec/ios/orientation_helper_specs.rb
motion-kit-1.0.2 spec/ios/orientation_helper_specs.rb
motion-kit-1.0.2 spec/tvos/orientation_helper_specs.rb
motion-kit-1.0.1 spec/ios/orientation_helper_specs.rb
motion-kit-1.0.1 spec/tvos/orientation_helper_specs.rb
motion-kit-1.0.0 spec/tvos/orientation_helper_specs.rb
motion-kit-1.0.0 spec/ios/orientation_helper_specs.rb
motion-kit-0.18.0 spec/ios/orientation_helper_specs.rb
motion-kit-0.17.0 spec/ios/orientation_helper_specs.rb
motion-kit-0.16.0 spec/ios/orientation_helper_specs.rb
motion-kit-0.15.0 spec/ios/orientation_helper_specs.rb
motion-kit-0.14.2 spec/ios/orientation_helper_specs.rb
motion-kit-0.14.1 spec/ios/orientation_helper_specs.rb
motion-kit-0.14.0 spec/ios/orientation_helper_specs.rb
motion-kit-0.13.0 spec/ios/orientation_helper_specs.rb