jasmine-core 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/lib/console/console.js +1 -1
  3. data/lib/jasmine-core/boot.js +1 -1
  4. data/lib/jasmine-core/jasmine-html.js +15 -7
  5. data/lib/jasmine-core/jasmine.js +261 -82
  6. data/lib/jasmine-core/node_boot.js +1 -1
  7. data/lib/jasmine-core/spec/console/ConsoleReporterSpec.js +16 -16
  8. data/lib/jasmine-core/spec/core/CallTrackerSpec.js +26 -11
  9. data/lib/jasmine-core/spec/core/ClockSpec.js +61 -42
  10. data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +28 -15
  11. data/lib/jasmine-core/spec/core/EnvSpec.js +8 -8
  12. data/lib/jasmine-core/spec/core/ExceptionFormatterSpec.js +6 -6
  13. data/lib/jasmine-core/spec/core/ExceptionsSpec.js +1 -1
  14. data/lib/jasmine-core/spec/core/ExpectationResultSpec.js +8 -8
  15. data/lib/jasmine-core/spec/core/ExpectationSpec.js +17 -17
  16. data/lib/jasmine-core/spec/core/JsApiReporterSpec.js +14 -14
  17. data/lib/jasmine-core/spec/core/MockDateSpec.js +14 -14
  18. data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +65 -56
  19. data/lib/jasmine-core/spec/core/QueueRunnerSpec.js +32 -18
  20. data/lib/jasmine-core/spec/core/ReportDispatcherSpec.js +27 -3
  21. data/lib/jasmine-core/spec/core/SpecSpec.js +37 -37
  22. data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +46 -7
  23. data/lib/jasmine-core/spec/core/SpySpec.js +11 -11
  24. data/lib/jasmine-core/spec/core/SpyStrategySpec.js +25 -13
  25. data/lib/jasmine-core/spec/core/SuiteSpec.js +25 -25
  26. data/lib/jasmine-core/spec/core/TimerSpec.js +2 -2
  27. data/lib/jasmine-core/spec/core/TreeProcessorSpec.js +26 -26
  28. data/lib/jasmine-core/spec/core/UtilSpec.js +12 -12
  29. data/lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js +8 -8
  30. data/lib/jasmine-core/spec/core/asymmetric_equality/AnythingSpec.js +7 -7
  31. data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js +6 -6
  32. data/lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js +11 -11
  33. data/lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js +4 -4
  34. data/lib/jasmine-core/spec/core/formatErrorMsgSpec.js +13 -0
  35. data/lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js +2 -2
  36. data/lib/jasmine-core/spec/core/integration/EnvSpec.js +195 -76
  37. data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +20 -21
  38. data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +164 -114
  39. data/lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js +4 -4
  40. data/lib/jasmine-core/spec/core/matchers/toBeDefinedSpec.js +2 -2
  41. data/lib/jasmine-core/spec/core/matchers/toBeFalsySpec.js +2 -2
  42. data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanOrEqualSpec.js +29 -0
  43. data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanSpec.js +2 -2
  44. data/lib/jasmine-core/spec/core/matchers/toBeLessThanOrEqualSpec.js +29 -0
  45. data/lib/jasmine-core/spec/core/matchers/toBeLessThanSpec.js +2 -2
  46. data/lib/jasmine-core/spec/core/matchers/toBeNaNSpec.js +3 -3
  47. data/lib/jasmine-core/spec/core/matchers/toBeNullSpec.js +2 -2
  48. data/lib/jasmine-core/spec/core/matchers/toBeSpec.js +2 -2
  49. data/lib/jasmine-core/spec/core/matchers/toBeTruthySpec.js +2 -2
  50. data/lib/jasmine-core/spec/core/matchers/toBeUndefinedSpec.js +2 -2
  51. data/lib/jasmine-core/spec/core/matchers/toContainSpec.js +4 -4
  52. data/lib/jasmine-core/spec/core/matchers/toEqualSpec.js +2 -2
  53. data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledSpec.js +11 -11
  54. data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledTimesSpec.js +22 -17
  55. data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledWithSpec.js +11 -10
  56. data/lib/jasmine-core/spec/core/matchers/toMatchSpec.js +7 -6
  57. data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +24 -24
  58. data/lib/jasmine-core/spec/core/matchers/toThrowSpec.js +9 -8
  59. data/lib/jasmine-core/spec/helpers/defineJasmineUnderTest.js +3 -3
  60. data/lib/jasmine-core/spec/helpers/nodeDefineJasmineUnderTest.js +5 -5
  61. data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +95 -59
  62. data/lib/jasmine-core/spec/html/HtmlSpecFilterSpec.js +3 -3
  63. data/lib/jasmine-core/spec/html/MatchersHtmlSpec.js +1 -1
  64. data/lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js +4 -4
  65. data/lib/jasmine-core/spec/html/QueryStringSpec.js +5 -5
  66. data/lib/jasmine-core/spec/html/ResultsNodeSpec.js +4 -4
  67. data/lib/jasmine-core/spec/npmPackage/npmPackageSpec.js +2 -2
  68. data/lib/jasmine-core/spec/performance/large_object_test.js +1 -1
  69. data/lib/jasmine-core/version.rb +1 -1
  70. metadata +5 -3
  71. data/lib/jasmine-core/spec/node_suite.js +0 -195
@@ -1,14 +1,14 @@
1
- describe("j$.HtmlSpecFilter", function() {
1
+ describe("jasmineUnderTest.HtmlSpecFilter", function() {
2
2
 
3
3
  it("should match when no string is provided", function() {
4
- var specFilter = new j$.HtmlSpecFilter();
4
+ var specFilter = new jasmineUnderTest.HtmlSpecFilter();
5
5
 
6
6
  expect(specFilter.matches("foo")).toBe(true);
7
7
  expect(specFilter.matches("*bar")).toBe(true);
8
8
  });
9
9
 
10
10
  it("should only match the provided string", function() {
11
- var specFilter = new j$.HtmlSpecFilter({
11
+ var specFilter = new jasmineUnderTest.HtmlSpecFilter({
12
12
  filterString: function() { return "foo"; }
13
13
  });
14
14
 
@@ -2,7 +2,7 @@ describe("MatchersSpec - HTML Dependent", function () {
2
2
  var env, spec;
3
3
 
4
4
  beforeEach(function() {
5
- env = new j$.Env();
5
+ env = new jasmineUnderTest.Env();
6
6
 
7
7
  var suite = env.describe("suite", function() {
8
8
  spec = env.it("spec", function() {
@@ -1,15 +1,15 @@
1
- describe("j$.pp (HTML Dependent)", function () {
1
+ describe("jasmineUnderTest.pp (HTML Dependent)", function () {
2
2
  it("should stringify HTML nodes properly", function() {
3
3
  var sampleNode = document.createElement('div');
4
4
  sampleNode.innerHTML = 'foo<b>bar</b>';
5
- expect(j$.pp(sampleNode)).toEqual("HTMLNode");
6
- expect(j$.pp({foo: sampleNode})).toEqual("Object({ foo: HTMLNode })");
5
+ expect(jasmineUnderTest.pp(sampleNode)).toEqual("HTMLNode");
6
+ expect(jasmineUnderTest.pp({foo: sampleNode})).toEqual("Object({ foo: HTMLNode })");
7
7
  });
8
8
 
9
9
  it("should print Firefox's wrapped native objects correctly", function() {
10
10
  if(jasmine.getEnv().firefoxVersion) {
11
11
  try { new CustomEvent(); } catch(e) { var err = e; };
12
- expect(j$.pp(err)).toMatch(/Not enough arguments/);
12
+ expect(jasmineUnderTest.pp(err)).toMatch(/Not enough arguments/);
13
13
  }
14
14
  });
15
15
  });
@@ -5,7 +5,7 @@ describe("QueryString", function() {
5
5
  var windowLocation = {
6
6
  search: ""
7
7
  },
8
- queryString = new j$.QueryString({
8
+ queryString = new jasmineUnderTest.QueryString({
9
9
  getWindowLocation: function() { return windowLocation }
10
10
  });
11
11
 
@@ -18,7 +18,7 @@ describe("QueryString", function() {
18
18
  var windowLocation = {
19
19
  search: "?foo=bar"
20
20
  },
21
- queryString = new j$.QueryString({
21
+ queryString = new jasmineUnderTest.QueryString({
22
22
  getWindowLocation: function() { return windowLocation }
23
23
  });
24
24
 
@@ -34,7 +34,7 @@ describe("QueryString", function() {
34
34
  var windowLocation = {
35
35
  search: "?foo=bar"
36
36
  },
37
- queryString = new j$.QueryString({
37
+ queryString = new jasmineUnderTest.QueryString({
38
38
  getWindowLocation: function() { return windowLocation }
39
39
  });
40
40
 
@@ -51,7 +51,7 @@ describe("QueryString", function() {
51
51
  var windowLocation = {
52
52
  search: "?baz=quux%20corge"
53
53
  },
54
- queryString = new j$.QueryString({
54
+ queryString = new jasmineUnderTest.QueryString({
55
55
  getWindowLocation: function() { return windowLocation }
56
56
  });
57
57
 
@@ -62,7 +62,7 @@ describe("QueryString", function() {
62
62
  var windowLocation = {
63
63
  search: ""
64
64
  },
65
- queryString = new j$.QueryString({
65
+ queryString = new jasmineUnderTest.QueryString({
66
66
  getWindowLocation: function() { return windowLocation }
67
67
  });
68
68
 
@@ -4,7 +4,7 @@ describe("ResultsNode", function() {
4
4
  id: 123,
5
5
  message: "foo"
6
6
  },
7
- node = new j$.ResultsNode(fakeResult, "suite", null);
7
+ node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);
8
8
 
9
9
  expect(node.result).toBe(fakeResult);
10
10
  expect(node.type).toEqual("suite");
@@ -19,7 +19,7 @@ describe("ResultsNode", function() {
19
19
  id: 456,
20
20
  message: "bar"
21
21
  },
22
- node = new j$.ResultsNode(fakeResult, "suite", null);
22
+ node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);
23
23
 
24
24
  node.addChild(fakeChildResult, "spec");
25
25
 
@@ -37,7 +37,7 @@ describe("ResultsNode", function() {
37
37
  id: 456,
38
38
  message: "bar"
39
39
  },
40
- node = new j$.ResultsNode(fakeResult, "suite", null);
40
+ node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);
41
41
 
42
42
  node.addChild(fakeChildResult, "spec");
43
43
 
@@ -53,7 +53,7 @@ describe("ResultsNode", function() {
53
53
  id: 456,
54
54
  message: "bar"
55
55
  },
56
- node = new j$.ResultsNode(fakeResult, "suite", null);
56
+ node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);
57
57
 
58
58
  node.addChild(fakeChildResult, "spec");
59
59
 
@@ -5,9 +5,9 @@ describe('npm package', function() {
5
5
 
6
6
  beforeAll(function() {
7
7
  var shell = require('shelljs'),
8
- pack = shell.exec('npm pack', { silent: true });
8
+ pack = shell.exec('npm pack', { silent: true});
9
9
 
10
- this.tarball = pack.output.split('\n')[0];
10
+ this.tarball = pack.stdout.split('\n')[0];
11
11
  this.tmpDir = temp.mkdirSync(); // automatically deleted on exit
12
12
 
13
13
  var untar = shell.exec('tar -xzf ' + this.tarball + ' -C ' + this.tmpDir, { silent: true });
@@ -30,7 +30,7 @@ describe('Printing a big object', function(){
30
30
 
31
31
  it('takes a resonable amount of time', function(){
32
32
  bigObject = generateObject(0);
33
- expect(j$.pp(bigObject)).toMatch(/cycle/);
33
+ expect(jasmineUnderTest.pp(bigObject)).toMatch(/cycle/);
34
34
  });
35
35
  });
36
36
 
@@ -4,6 +4,6 @@
4
4
  #
5
5
  module Jasmine
6
6
  module Core
7
- VERSION = "2.4.1"
7
+ VERSION = "2.5.0"
8
8
  end
9
9
  end
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.4.1
4
+ version: 2.5.0
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: 2015-12-04 00:00:00.000000000 Z
13
+ date: 2016-08-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -123,6 +123,7 @@ files:
123
123
  - "./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js"
124
124
  - "./lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js"
125
125
  - "./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js"
126
+ - "./lib/jasmine-core/spec/core/formatErrorMsgSpec.js"
126
127
  - "./lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js"
127
128
  - "./lib/jasmine-core/spec/core/integration/EnvSpec.js"
128
129
  - "./lib/jasmine-core/spec/core/integration/SpecRunningSpec.js"
@@ -130,7 +131,9 @@ files:
130
131
  - "./lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js"
131
132
  - "./lib/jasmine-core/spec/core/matchers/toBeDefinedSpec.js"
132
133
  - "./lib/jasmine-core/spec/core/matchers/toBeFalsySpec.js"
134
+ - "./lib/jasmine-core/spec/core/matchers/toBeGreaterThanOrEqualSpec.js"
133
135
  - "./lib/jasmine-core/spec/core/matchers/toBeGreaterThanSpec.js"
136
+ - "./lib/jasmine-core/spec/core/matchers/toBeLessThanOrEqualSpec.js"
134
137
  - "./lib/jasmine-core/spec/core/matchers/toBeLessThanSpec.js"
135
138
  - "./lib/jasmine-core/spec/core/matchers/toBeNaNSpec.js"
136
139
  - "./lib/jasmine-core/spec/core/matchers/toBeNullSpec.js"
@@ -154,7 +157,6 @@ files:
154
157
  - "./lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js"
155
158
  - "./lib/jasmine-core/spec/html/QueryStringSpec.js"
156
159
  - "./lib/jasmine-core/spec/html/ResultsNodeSpec.js"
157
- - "./lib/jasmine-core/spec/node_suite.js"
158
160
  - "./lib/jasmine-core/spec/npmPackage/npmPackageSpec.js"
159
161
  - "./lib/jasmine-core/spec/performance/large_object_test.js"
160
162
  - "./lib/jasmine-core/spec/performance/performance_test.js"
@@ -1,195 +0,0 @@
1
- var fs = require('fs');
2
- var util = require('util');
3
- var path = require('path');
4
-
5
- // boot code for jasmine
6
- var jasmineRequire = require('../lib/jasmine-core/jasmine.js');
7
- var jasmine = jasmineRequire.core(jasmineRequire);
8
-
9
- var consoleFns = require('../lib/console/console.js');
10
- extend(jasmineRequire, consoleFns);
11
- jasmineRequire.console(jasmineRequire, jasmine);
12
-
13
- var env = jasmine.getEnv();
14
-
15
- var jasmineInterface = {
16
- describe: function(description, specDefinitions) {
17
- return env.describe(description, specDefinitions);
18
- },
19
-
20
- xdescribe: function(description, specDefinitions) {
21
- return env.xdescribe(description, specDefinitions);
22
- },
23
-
24
- it: function(desc, func) {
25
- return env.it(desc, func);
26
- },
27
-
28
- xit: function(desc, func) {
29
- return env.xit(desc, func);
30
- },
31
-
32
- beforeEach: function(beforeEachFunction) {
33
- return env.beforeEach(beforeEachFunction);
34
- },
35
-
36
- afterEach: function(afterEachFunction) {
37
- return env.afterEach(afterEachFunction);
38
- },
39
-
40
- expect: function(actual) {
41
- return env.expect(actual);
42
- },
43
-
44
- spyOn: function(obj, methodName) {
45
- return env.spyOn(obj, methodName);
46
- },
47
-
48
- jsApiReporter: new jasmine.JsApiReporter({
49
- timer: new jasmine.Timer()
50
- }),
51
-
52
- beforeAll: function(beforeAllFunction) {
53
- return env.beforeAll(beforeAllFunction);
54
- },
55
-
56
- afterAll: function(afterAllFunction) {
57
- return env.afterAll(afterAllFunction);
58
- }
59
- };
60
-
61
- extend(global, jasmineInterface);
62
-
63
- function extend(destination, source) {
64
- for (var property in source) destination[property] = source[property];
65
- return destination;
66
- }
67
-
68
- jasmine.addCustomEqualityTester = function(tester) {
69
- env.addCustomEqualityTester(tester);
70
- };
71
-
72
- jasmine.addMatchers = function(matchers) {
73
- return env.addMatchers(matchers);
74
- };
75
-
76
- jasmine.clock = function() {
77
- return env.clock;
78
- };
79
-
80
- // Jasmine "runner"
81
- function executeSpecs(specs, done, isVerbose, showColors) {
82
- global.jasmine = jasmine;
83
-
84
- for (var i = 0; i < specs.length; i++) {
85
- var filename = specs[i];
86
- require(filename.replace(/\.\w+$/, ""));
87
- }
88
-
89
- var env = jasmine.getEnv();
90
- var consoleReporter = new jasmine.ConsoleReporter({
91
- print: util.print,
92
- onComplete: done,
93
- showColors: showColors,
94
- timer: new jasmine.Timer()
95
- });
96
-
97
- env.addReporter(consoleReporter);
98
- env.execute();
99
- }
100
-
101
- function getFiles(dir, matcher) {
102
- var allFiles = [];
103
-
104
- if (fs.statSync(dir).isFile() && dir.match(matcher)) {
105
- allFiles.push(dir);
106
- } else {
107
- var files = fs.readdirSync(dir);
108
- for (var i = 0, len = files.length; i < len; ++i) {
109
- var filename = dir + '/' + files[i];
110
- if (fs.statSync(filename).isFile() && filename.match(matcher)) {
111
- allFiles.push(filename);
112
- } else if (fs.statSync(filename).isDirectory()) {
113
- var subfiles = getFiles(filename);
114
- subfiles.forEach(function(result) {
115
- allFiles.push(result);
116
- });
117
- }
118
- }
119
- }
120
- return allFiles;
121
- }
122
-
123
- function getSpecFiles(dir) {
124
- return getFiles(dir, new RegExp("Spec.js$"));
125
- }
126
-
127
- var j$require = (function() {
128
- var exported = {},
129
- j$req;
130
-
131
- global.getJasmineRequireObj = getJasmineRequireObj;
132
-
133
- j$req = require(__dirname + "/../src/core/requireCore.js");
134
- extend(j$req, require(__dirname + "/../src/console/requireConsole.js"));
135
-
136
- var srcFiles = getFiles(__dirname + "/../src/core");
137
- srcFiles.push(__dirname + "/../src/version.js");
138
- srcFiles.push(__dirname + "/../src/console/ConsoleReporter.js");
139
-
140
- for (var i = 0; i < srcFiles.length; i++) {
141
- require(srcFiles[i]);
142
- }
143
- extend(j$req, exported);
144
-
145
- delete global.getJasmineRequireObj;
146
-
147
- return j$req;
148
-
149
- function getJasmineRequireObj() {
150
- return exported;
151
- }
152
- }());
153
-
154
- j$ = j$require.core(j$require);
155
- j$require.console(j$require, j$);
156
-
157
- // options from command line
158
- var isVerbose = false;
159
- var showColors = true;
160
- var perfSuite = false;
161
-
162
- process.argv.forEach(function(arg) {
163
- switch (arg) {
164
- case '--color':
165
- showColors = true;
166
- break;
167
- case '--noColor':
168
- showColors = false;
169
- break;
170
- case '--verbose':
171
- isVerbose = true;
172
- break;
173
- case '--perf':
174
- perfSuite = true;
175
- break;
176
- }
177
- });
178
-
179
- specs = [];
180
-
181
- if (perfSuite) {
182
- specs = getFiles(__dirname + '/performance', new RegExp("test.js$"));
183
- } else {
184
- var consoleSpecs = getSpecFiles(__dirname + "/console"),
185
- coreSpecs = getSpecFiles(__dirname + "/core"),
186
- specs = consoleSpecs.concat(coreSpecs);
187
- }
188
-
189
- executeSpecs(specs, function(passed) {
190
- if (passed) {
191
- process.exit(0);
192
- } else {
193
- process.exit(1);
194
- }
195
- }, isVerbose, showColors);