Sha256: 102c58dabe055c0d7b5c510b44dbbc0ce5a6e2ec44b6ff4d59e0b5babe498580
Contents?: true
Size: 1.14 KB
Versions: 6
Compression:
Stored size: 1.14 KB
Contents
describe BubbleWrap::Device::CameraWrapper do before do BW::Device.camera.instance_variable_set(:@front, nil) BW::Device.camera.instance_variable_set(:@rear, nil) end 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
6 entries across 6 versions & 1 rubygems