jasmine-core 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 774cee200c94a97754d9739a092c927bed3c47b5
|
4
|
+
data.tar.gz: 9fffe598451f68c2123a86d668196fc84a1f19ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d518ed2a10b8238dd7d96fb65e5249007d7b8fc6fd94412e4597f0c8cd6aa27e73d06073c7da3e6d91cd17b80015dd9f9e7c6cbfa4bd4d24325c151e787144b4
|
7
|
+
data.tar.gz: 5724768ad8f93bd18e26956316aad9b28fd797cb1d3142bf2f17ce7e94a95861cf2f82e5282ecd5437bfc3d224f7b0fe49b91e4ab76493417441c44d032dcf17
|
data/lib/jasmine-core/jasmine.js
CHANGED
@@ -1428,7 +1428,7 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
|
|
1428
1428
|
function runScheduledFunctions(endTime, tickDate) {
|
1429
1429
|
tickDate = tickDate || function() {};
|
1430
1430
|
if (scheduledLookup.length === 0 || scheduledLookup[0] > endTime) {
|
1431
|
-
tickDate(endTime);
|
1431
|
+
tickDate(endTime - currentTime);
|
1432
1432
|
return;
|
1433
1433
|
}
|
1434
1434
|
|
@@ -1455,6 +1455,11 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
|
|
1455
1455
|
// scheduled in a funcToRun from forcing an extra iteration
|
1456
1456
|
currentTime !== endTime &&
|
1457
1457
|
scheduledLookup[0] <= endTime);
|
1458
|
+
|
1459
|
+
// ran out of functions to call, but still time left on the clock
|
1460
|
+
if (currentTime !== endTime) {
|
1461
|
+
tickDate(endTime - currentTime);
|
1462
|
+
}
|
1458
1463
|
}
|
1459
1464
|
}
|
1460
1465
|
|
@@ -2088,7 +2093,9 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
|
2088
2093
|
};
|
2089
2094
|
} else {
|
2090
2095
|
restoreStrategy = function() {
|
2091
|
-
delete obj[methodName]
|
2096
|
+
if (!delete obj[methodName]) {
|
2097
|
+
obj[methodName] = originalMethod;
|
2098
|
+
}
|
2092
2099
|
};
|
2093
2100
|
}
|
2094
2101
|
|
@@ -2984,16 +2991,20 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|
2984
2991
|
}
|
2985
2992
|
|
2986
2993
|
var extraKeys = [];
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2994
|
+
if (allKeys.length === 0) {
|
2995
|
+
return allKeys;
|
2996
|
+
}
|
2997
|
+
|
2998
|
+
for (var x = 0; x < allKeys.length; x++) {
|
2999
|
+
if (!allKeys[x].match(/^[0-9]+$/)) {
|
3000
|
+
extraKeys.push(allKeys[x]);
|
3001
|
+
}
|
2991
3002
|
}
|
2992
3003
|
|
2993
3004
|
return extraKeys;
|
2994
3005
|
}
|
2995
3006
|
}
|
2996
|
-
|
3007
|
+
|
2997
3008
|
function has(obj, key) {
|
2998
3009
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
2999
3010
|
}
|
@@ -3629,5 +3640,5 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|
3629
3640
|
};
|
3630
3641
|
|
3631
3642
|
getJasmineRequireObj().version = function() {
|
3632
|
-
return '2.5.
|
3643
|
+
return '2.5.1';
|
3633
3644
|
};
|
@@ -666,9 +666,17 @@ describe("Clock (acceptance)", function() {
|
|
666
666
|
var pushCurrentTime = function() { actualTimes.push(global.Date().getTime()); };
|
667
667
|
delayedFunctionScheduler.scheduleFunction(pushCurrentTime);
|
668
668
|
delayedFunctionScheduler.scheduleFunction(pushCurrentTime, 1);
|
669
|
+
delayedFunctionScheduler.scheduleFunction(pushCurrentTime, 3);
|
669
670
|
|
670
671
|
clock.tick(1);
|
672
|
+
expect(global.Date().getTime()).toEqual(baseTime.getTime() + 1);
|
671
673
|
|
672
|
-
|
674
|
+
clock.tick(3);
|
675
|
+
expect(global.Date().getTime()).toEqual(baseTime.getTime() + 4);
|
676
|
+
|
677
|
+
clock.tick(1);
|
678
|
+
expect(global.Date().getTime()).toEqual(baseTime.getTime() + 5);
|
679
|
+
|
680
|
+
expect(actualTimes).toEqual([baseTime.getTime(), baseTime.getTime() + 1, baseTime.getTime() + 3]);
|
673
681
|
})
|
674
682
|
});
|
@@ -127,6 +127,29 @@ describe("SpyRegistry", function() {
|
|
127
127
|
|
128
128
|
expect(subject.hasOwnProperty('spiedFunc')).toBe(false);
|
129
129
|
expect(subject.spiedFunc).toBe(originalFunction);
|
130
|
-
})
|
130
|
+
});
|
131
|
+
|
132
|
+
it("restores the original function when it\'s inherited and cannot be deleted", function() {
|
133
|
+
// IE 8 doesn't support `Object.create` or `Object.defineProperty`
|
134
|
+
if (jasmine.getEnv().ieVersion < 9) { return; }
|
135
|
+
|
136
|
+
var spies = [],
|
137
|
+
spyRegistry = new jasmineUnderTest.SpyRegistry({currentSpies: function() { return spies; }}),
|
138
|
+
originalFunction = function() {},
|
139
|
+
subjectParent = {spiedFunc: originalFunction};
|
140
|
+
|
141
|
+
var subject = Object.create(subjectParent);
|
142
|
+
|
143
|
+
spyRegistry.spyOn(subject, 'spiedFunc');
|
144
|
+
|
145
|
+
// simulate a spy that cannot be deleted
|
146
|
+
Object.defineProperty(subject, 'spiedFunc', {
|
147
|
+
configurable: false
|
148
|
+
});
|
149
|
+
|
150
|
+
spyRegistry.clearSpies();
|
151
|
+
|
152
|
+
expect(jasmineUnderTest.isSpy(subject.spiedFunc)).toBe(false);
|
153
|
+
});
|
131
154
|
});
|
132
155
|
});
|
data/lib/jasmine-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajan Agaskar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|