diff options
| author | Misko Hevery | 2012-01-06 18:10:47 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2012-01-10 22:27:00 -0800 | 
| commit | 5143e7bf065a3cbdf8400cf095b653d51bc83b8f (patch) | |
| tree | 980149c365d4cb5586d27975d26366a25ff7be6a /test/angular-mocksSpec.js | |
| parent | afd25446d23f24872eb20ac79c8fbd2cff203ef0 (diff) | |
| download | angular.js-5143e7bf065a3cbdf8400cf095b653d51bc83b8f.tar.bz2 | |
feat(module): new module loader
Diffstat (limited to 'test/angular-mocksSpec.js')
| -rw-r--r-- | test/angular-mocksSpec.js | 54 | 
1 files changed, 27 insertions, 27 deletions
| diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js index 054cabae..d7f40bb2 100644 --- a/test/angular-mocksSpec.js +++ b/test/angular-mocksSpec.js @@ -32,95 +32,95 @@ describe('mocks', function() {      }      it('should look like a Date', function() { -      var date = new angular.module.ngMock.TzDate(0,0); +      var date = new angular.mock.TzDate(0,0);        expect(angular.isDate(date)).toBe(true);      });      it('should take millis as constructor argument', function() { -      expect(new angular.module.ngMock.TzDate(0, 0).getTime()).toBe(0); -      expect(new angular.module.ngMock.TzDate(0, 1283555108000).getTime()).toBe(1283555108000); +      expect(new angular.mock.TzDate(0, 0).getTime()).toBe(0); +      expect(new angular.mock.TzDate(0, 1283555108000).getTime()).toBe(1283555108000);      });      it('should take dateString as constructor argument', function() { -      expect(new angular.module.ngMock.TzDate(0, '1970-01-01T00:00:00.000Z').getTime()).toBe(0); -      expect(new angular.module.ngMock.TzDate(0, '2010-09-03T23:05:08.023Z').getTime()).toBe(1283555108023); +      expect(new angular.mock.TzDate(0, '1970-01-01T00:00:00.000Z').getTime()).toBe(0); +      expect(new angular.mock.TzDate(0, '2010-09-03T23:05:08.023Z').getTime()).toBe(1283555108023);      });      it('should fake getLocalDateString method', function() {        //0 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, 0); +      var t0 = new angular.mock.TzDate(-3, 0);        expect(t0.toLocaleDateString()).toMatch('1970');        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, 0); +      var t1 = new angular.mock.TzDate(0, 0);        expect(t1.toLocaleDateString()).toMatch('1970');        //0 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, 0); +      var t2 = new angular.mock.TzDate(3, 0);        expect(t2.toLocaleDateString()).toMatch('1969');      });      it('should fake getHours method', function() {        //0 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, 0); +      var t0 = new angular.mock.TzDate(-3, 0);        expect(t0.getHours()).toBe(3);        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, 0); +      var t1 = new angular.mock.TzDate(0, 0);        expect(t1.getHours()).toBe(0);        //0 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, 0); +      var t2 = new angular.mock.TzDate(3, 0);        expect(t2.getHours()).toMatch(21);      });      it('should fake getMinutes method', function() {        //0:15 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, minutes(15)); +      var t0 = new angular.mock.TzDate(-3, minutes(15));        expect(t0.getMinutes()).toBe(15);        //0:15 in -3.25h -      var t0a = new angular.module.ngMock.TzDate(-3.25, minutes(15)); +      var t0a = new angular.mock.TzDate(-3.25, minutes(15));        expect(t0a.getMinutes()).toBe(30);        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, minutes(0)); +      var t1 = new angular.mock.TzDate(0, minutes(0));        expect(t1.getMinutes()).toBe(0);        //0:15 in +0h -      var t1a = new angular.module.ngMock.TzDate(0, minutes(15)); +      var t1a = new angular.mock.TzDate(0, minutes(15));        expect(t1a.getMinutes()).toBe(15);        //0:15 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, minutes(15)); +      var t2 = new angular.mock.TzDate(3, minutes(15));        expect(t2.getMinutes()).toMatch(15);        //0:15 in +3.25h -      var t2a = new angular.module.ngMock.TzDate(3.25, minutes(15)); +      var t2a = new angular.mock.TzDate(3.25, minutes(15));        expect(t2a.getMinutes()).toMatch(0);      });      it('should fake getSeconds method', function() {        //0 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, 0); +      var t0 = new angular.mock.TzDate(-3, 0);        expect(t0.getSeconds()).toBe(0);        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, 0); +      var t1 = new angular.mock.TzDate(0, 0);        expect(t1.getSeconds()).toBe(0);        //0 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, 0); +      var t2 = new angular.mock.TzDate(3, 0);        expect(t2.getSeconds()).toMatch(0);      });      it('should create a date representing new year in Bratislava', function() { -      var newYearInBratislava = new angular.module.ngMock.TzDate(-1, '2009-12-31T23:00:00.000Z'); +      var newYearInBratislava = new angular.mock.TzDate(-1, '2009-12-31T23:00:00.000Z');        expect(newYearInBratislava.getTimezoneOffset()).toBe(-60);        expect(newYearInBratislava.getFullYear()).toBe(2010);        expect(newYearInBratislava.getMonth()).toBe(0); @@ -132,7 +132,7 @@ describe('mocks', function() {      it('should delegate all the UTC methods to the original UTC Date object', function() {        //from when created from string -      var date1 = new angular.module.ngMock.TzDate(-1, '2009-12-31T23:00:00.000Z'); +      var date1 = new angular.mock.TzDate(-1, '2009-12-31T23:00:00.000Z');        expect(date1.getUTCFullYear()).toBe(2009);        expect(date1.getUTCMonth()).toBe(11);        expect(date1.getUTCDate()).toBe(31); @@ -142,7 +142,7 @@ describe('mocks', function() {        //from when created from millis -      var date2 = new angular.module.ngMock.TzDate(-1, date1.getTime()); +      var date2 = new angular.mock.TzDate(-1, date1.getTime());        expect(date2.getUTCFullYear()).toBe(2009);        expect(date2.getUTCMonth()).toBe(11);        expect(date2.getUTCDate()).toBe(31); @@ -153,7 +153,7 @@ describe('mocks', function() {      it('should throw error when no third param but toString called', function() { -      expect(function() { new angular.module.ngMock.TzDate(0,0).toString(); }). +      expect(function() { new angular.mock.TzDate(0,0).toString(); }).                             toThrow('Method \'toString\' is not implemented in the TzDate mock');      });    }); @@ -318,8 +318,8 @@ describe('mocks', function() {    }); -  describe('angular.module.ngMock.dump', function(){ -    var d = angular.module.ngMock.dump; +  describe('angular.mock.dump', function(){ +    var d = angular.mock.dump;      it('should serialize primitive types', function(){ @@ -379,7 +379,7 @@ describe('mocks', function() {          function($provide) {            realBackendSpy = jasmine.createSpy('realBackend');            $provide.value('$httpBackend', realBackendSpy); -          $provide.decorator('$httpBackend', angular.module.ngMock.$httpBackendDecorator) +          $provide.decorator('$httpBackend', angular.mock.$httpBackendDecorator)          },          function($httpBackend) {            callback = jasmine.createSpy('callback'); | 
