Closed cognitiveflux closed 9 years ago
Admittedly I'm not the most experienced with rspec, tried adding the following but it reported 'MISSING - empty specification' for both. Also receiving NoMethodError for should_receive, any suggestions welcome:
it "should throw an error if location is unknown" do
BW::Location.get do |result|
result[:error].should == BW::Location::Error::LOCATION_UNKNOWN
end
error = NSError.errorWithDomain(KCLErrorDomain, code: KCLErrorLocationUnknown, userInfo: nil)
BW::Location.locationManager(location_manager, didFailWithError: error)
end
it "should restart location services if it receives a LocationUnknown error" do
BW::Location.get do |result|
result[:error].should == BW::Location::Error::LOCATION_UNKNOWN
end
BW::Location.should_receive(:stop)
BW::Location.should_receive(:start)
error = NSError.errorWithDomain(KCLErrorDomain, code: KCLErrorLocationUnknown, userInfo: nil)
BW::Location.locationManager(location_manager, didFailWithError: error)
end
:cry: It's still not working. Check this app. If you leave it running for 15 minutes on City Bicycle Ride in the simulator it will get error: 3
and crash.
I've also merged both 432+422 and tested but I have the same result. Check this branch.
Before anyone would say :stuck_out_tongue_winking_eye: Yes, I did rake clean:all, reset the simulator, blah, blah, blah
Current BW::Location implementation only restarts immediate location services (not compass or significant change) on receiving a KCLErrorLocationUnknown error Updated to restart services based on the user provided options and method invocation (in the same way that services are stopped)