Sha256: 3347dee2896509b02dd12ac612dd0c46b7a7dba1f44f7a180149f67e0fefdfe5

Contents?: true

Size: 1.61 KB

Versions: 9

Compression:

Stored size: 1.61 KB

Contents

describe BubbleWrap::Device do
describe "iOS" do
  describe 'on iPhone' do
    before do
      @idiom = UIUserInterfaceIdiomPhone
    end

    describe '.iphone?' do
      it 'returns true' do
        BW::Device.iphone?(@idiom).should == true
      end
    end

    describe '.ipad?' do
      it 'returns false' do
        BW::Device.ipad?(@idiom).should == false
      end
    end

    describe '.long_screen?' do
      it 'returns true if screen is wide' do
        BW::Device.long_screen?(@idiom, 568.0).should == true
      end

      it 'returns false if screen is not wide' do
        BW::Device.long_screen?(@idiom, 480.0).should == false
      end
    end
  end

  describe 'on iPad' do
    before do
      @idiom = UIUserInterfaceIdiomPad
    end

    describe '.iphone?' do
      it 'returns false' do
        BW::Device.iphone?(@idiom).should == false
      end
    end

    describe '.ipad?' do
      it 'returns true' do
        BW::Device.ipad?(@idiom).should == true
      end
    end

    describe '.long_screen?' do
      it 'always not a widescreen' do
        BW::Device.long_screen?(@idiom, 1024.0).should == false
      end
    end
  end

  describe '.simulator?' do
    it 'returns true' do
      BW::Device.simulator?.should == true
    end
  end

  describe '.ios_version' do
    it 'returns true' do
      # exact value depends on system where specs run. 4.0 seems like a safe guess
      BW::Device.ios_version.should > '4.0'
    end
  end

  describe '.orientation' do
    it 'delegates to BubbleWrap::Screen.orientation' do
      BW::Device.orientation.should == BW::Device::Screen.orientation
    end
  end
end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bubble-wrap-1.7.1 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.7.0 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.6.0 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.6.0.rc1 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.5.0 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.5.0.rc1 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.4.0 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.3.0 spec/motion/core/device/ios/device_spec.rb
bubble-wrap-1.3.0.osx spec/motion/core/device/ios/device_spec.rb