Sha256: bfeaa5866f91ddc5e5bf6188c1ba51aff4da0223ac0d50778cef775a8622529d

Contents?: true

Size: 1 KB

Versions: 5

Compression:

Stored size: 1 KB

Contents

describe BubbleWrap::Device::CameraWrapper do
  describe 'on device with only front facing camera' do
    before do
      UIImagePickerController.instance_eval do
        def isCameraDeviceAvailable(c)
          c == UIImagePickerControllerCameraDeviceFront
        end
      end
    end

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

    describe '.rear?' do
      it 'returns false' do
        BW::Device.camera.rear?.should == false
      end
    end
  end

  describe 'on device with only rear facing camera' do
    before do
      UIImagePickerController.instance_eval do
        def isCameraDeviceAvailable(c)
          c == UIImagePickerControllerCameraDeviceRear
        end
      end
    end

    describe '.front?' do
      it 'returns false' do
        BW::Device.camera.front?.should == false
      end
    end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bubble-wrap-1.1.4 spec/motion/core/device/camera_wrapper_spec.rb
bubble-wrap-1.1.3 spec/motion/core/device/camera_wrapper_spec.rb
bubble-wrap-1.1.2 spec/motion/core/device/camera_wrapper_spec.rb
bubble-wrap-1.1.1 spec/motion/core/device/camera_wrapper_spec.rb
bubble-wrap-1.1.0 spec/motion/core/device/camera_wrapper_spec.rb