<commit_before>describe('ngCordovaMocks', function() {
	beforeEach(function() {
		module('ngCordovaMocks');
	});

	describe('cordovaGeolocation', function () {
		var count = 0;
		var $interval = null;
		var $rootScope = null;
		var $cordovaGeolocation = null;
		var gpsOptions = {};

		beforeEach(inject(function (_$cordovaGeolocation_, _$rootScope_, _$interval_) {
			$cordovaGeolocation = _$cordovaGeolocation_;
			$rootScope = _$rootScope_;
			$interval = _$interval_;
			count = 0;
		}));

		it('should get the current position', function (done) {
			var expected = { x:1, y:1, z:1, timestamp:Date() };
			$cordovaGeolocation.currentPosition = expected;
			$cordovaGeolocation.useHostAbilities = false;

			$cordovaGeolocation.getCurrentPosition()
				.then(
					function(actual) { expect(actual).toBe(expected); },
					function() { expect(false).toBe(true); }
				)
				.finally(function() { done(); })
			;

			$rootScope.$digest();
		});

		it('should throw an error while getting the current position.', function(done) {
			$cordovaGeolocation.throwsError = true;<commit_msg>Resul structure should be consistent to the implementation (coords property)<commit_after>describe('ngCordovaMocks', function() {
	beforeEach(function() {
		module('ngCordovaMocks');
	});

	describe('cordovaGeolocation', function () {
		var count = 0;
		var $interval = null;
		var $rootScope = null;
		var $cordovaGeolocation = null;
		var gpsOptions = {};

		beforeEach(inject(function (_$cordovaGeolocation_, _$rootScope_, _$interval_) {
			$cordovaGeolocation = _$cordovaGeolocation_;
			$rootScope = _$rootScope_;
			$interval = _$interval_;
			count = 0;
		}));

		it('should get the current position', function (done) {
			var expected = {coords: { longitude:1, y:1, latitude:1 }, timestamp:Date()};
			$cordovaGeolocation.currentPosition = expected;
			$cordovaGeolocation.useHostAbilities = false;

			$cordovaGeolocation.getCurrentPosition()
				.then(
					function(actual) { expect(actual).toBe(expected); },
					function() { expect(false).toBe(true); }
				)
				.finally(function() { done(); })
			;

			$rootScope.$digest();
		});

		it('should throw an error while getting the current position.', function(done) {
			$cordovaGeolocation.throwsError = true;
{'fraction_non_alphanumeric': 0.14393268379096547, 'fraction_numerical': 0.0044286979627989375, 'mean_word_length': 4.52322738386308, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4098296', 'n_tokens_mistral': 840, 'n_tokens_neox': 715, 'n_words': 149}