jasmine-core 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/console/console.js +26 -2
- data/lib/jasmine-core.js +31 -23
- data/lib/jasmine-core/boot.js +1 -1
- data/lib/jasmine-core/boot/boot.js +1 -1
- data/lib/jasmine-core/example/node_example/spec/PlayerSpec.js +2 -2
- data/lib/jasmine-core/jasmine-html.js +16 -2
- data/lib/jasmine-core/jasmine.css +11 -10
- data/lib/jasmine-core/jasmine.js +709 -395
- data/lib/jasmine-core/json2.js +73 -62
- data/lib/jasmine-core/spec/console/ConsoleReporterSpec.js +39 -8
- data/lib/jasmine-core/spec/core/ClockSpec.js +19 -1
- data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +13 -0
- data/lib/jasmine-core/spec/core/EnvSpec.js +0 -63
- data/lib/jasmine-core/spec/core/ExpectationSpec.js +15 -53
- data/lib/jasmine-core/spec/core/JsApiReporterSpec.js +37 -0
- data/lib/jasmine-core/spec/core/MockDateSpec.js +1 -0
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +8 -2
- data/lib/jasmine-core/spec/core/QueueRunnerSpec.js +91 -66
- data/lib/jasmine-core/spec/core/SpecSpec.js +25 -26
- data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +55 -0
- data/lib/jasmine-core/spec/core/SpySpec.js +10 -0
- data/lib/jasmine-core/spec/core/SpyStrategySpec.js +13 -0
- data/lib/jasmine-core/spec/core/SuiteSpec.js +108 -10
- data/lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js +34 -32
- data/lib/jasmine-core/spec/core/integration/EnvSpec.js +950 -35
- data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +279 -3
- data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +10 -1
- data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +5 -5
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +30 -2
- data/lib/jasmine-core/spec/node_suite.js +195 -0
- data/lib/jasmine-core/spec/npmPackage/npmPackageSpec.js +104 -0
- data/lib/jasmine-core/version.rb +1 -1
- metadata +6 -3
@@ -0,0 +1,104 @@
|
|
1
|
+
describe('npm package', function() {
|
2
|
+
var path = require('path'),
|
3
|
+
fs = require('fs');
|
4
|
+
|
5
|
+
beforeAll(function() {
|
6
|
+
var shell = require('shelljs'),
|
7
|
+
pack = shell.exec('npm pack', { silent: true });
|
8
|
+
|
9
|
+
this.tarball = pack.output.split('\n')[0];
|
10
|
+
this.tmpDir = '/tmp/jasmine-core';
|
11
|
+
|
12
|
+
fs.mkdirSync(this.tmpDir);
|
13
|
+
|
14
|
+
var untar = shell.exec('tar -xzf ' + this.tarball + ' -C ' + this.tmpDir, { silent: true });
|
15
|
+
expect(untar.code).toBe(0);
|
16
|
+
|
17
|
+
this.packagedCore = require(path.join(this.tmpDir, 'package/lib/jasmine-core.js'));
|
18
|
+
});
|
19
|
+
|
20
|
+
beforeEach(function() {
|
21
|
+
jasmine.addMatchers({
|
22
|
+
toExistInPath: function(util, customEquality) {
|
23
|
+
return {
|
24
|
+
compare: function(actual, expected) {
|
25
|
+
var fullPath = path.resolve(expected, actual);
|
26
|
+
return {
|
27
|
+
pass: fs.existsSync(fullPath)
|
28
|
+
};
|
29
|
+
}
|
30
|
+
};
|
31
|
+
}
|
32
|
+
});
|
33
|
+
});
|
34
|
+
|
35
|
+
afterAll(function() {
|
36
|
+
var cleanup = function (parent, fileOrFolder) {
|
37
|
+
var fullPath = path.join(parent, fileOrFolder);
|
38
|
+
if (fs.statSync(fullPath).isFile()) {
|
39
|
+
fs.unlinkSync(fullPath);
|
40
|
+
} else {
|
41
|
+
fs.readdirSync(fullPath).forEach(cleanup.bind(null, fullPath));
|
42
|
+
fs.rmdirSync(fullPath);
|
43
|
+
}
|
44
|
+
};
|
45
|
+
|
46
|
+
fs.unlink(this.tarball);
|
47
|
+
fs.readdirSync(this.tmpDir).forEach(cleanup.bind(null, this.tmpDir));
|
48
|
+
fs.rmdirSync(this.tmpDir);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('has a root path', function() {
|
52
|
+
expect(this.packagedCore.files.path).toEqual(fs.realpathSync(path.resolve(this.tmpDir, 'package/lib/jasmine-core')));
|
53
|
+
});
|
54
|
+
|
55
|
+
it('has a bootDir', function() {
|
56
|
+
expect(this.packagedCore.files.bootDir).toEqual(fs.realpathSync(path.resolve(this.tmpDir, 'package/lib/jasmine-core')));
|
57
|
+
});
|
58
|
+
|
59
|
+
it('has jsFiles', function() {
|
60
|
+
expect(this.packagedCore.files.jsFiles).toEqual([
|
61
|
+
'jasmine.js',
|
62
|
+
'jasmine-html.js',
|
63
|
+
'json2.js'
|
64
|
+
]);
|
65
|
+
|
66
|
+
var packagedCore = this.packagedCore;
|
67
|
+
this.packagedCore.files.jsFiles.forEach(function(fileName) {
|
68
|
+
expect(fileName).toExistInPath(packagedCore.files.path);
|
69
|
+
});
|
70
|
+
});
|
71
|
+
|
72
|
+
it('has cssFiles', function() {
|
73
|
+
expect(this.packagedCore.files.cssFiles).toEqual(['jasmine.css']);
|
74
|
+
|
75
|
+
var packagedCore = this.packagedCore;
|
76
|
+
this.packagedCore.files.cssFiles.forEach(function(fileName) {
|
77
|
+
expect(fileName).toExistInPath(packagedCore.files.path);
|
78
|
+
});
|
79
|
+
});
|
80
|
+
|
81
|
+
it('has bootFiles', function() {
|
82
|
+
expect(this.packagedCore.files.bootFiles).toEqual(['boot.js']);
|
83
|
+
expect(this.packagedCore.files.nodeBootFiles).toEqual(['node_boot.js']);
|
84
|
+
|
85
|
+
var packagedCore = this.packagedCore;
|
86
|
+
this.packagedCore.files.bootFiles.forEach(function(fileName) {
|
87
|
+
expect(fileName).toExistInPath(packagedCore.files.bootDir);
|
88
|
+
});
|
89
|
+
|
90
|
+
var packagedCore = this.packagedCore;
|
91
|
+
this.packagedCore.files.nodeBootFiles.forEach(function(fileName) {
|
92
|
+
expect(fileName).toExistInPath(packagedCore.files.bootDir);
|
93
|
+
});
|
94
|
+
});
|
95
|
+
|
96
|
+
it('has an imagesDir', function() {
|
97
|
+
expect(this.packagedCore.files.imagesDir).toEqual(fs.realpathSync(path.resolve(this.tmpDir, 'package/images')));
|
98
|
+
var images = fs.readdirSync(path.resolve(this.tmpDir, 'package/images'));
|
99
|
+
|
100
|
+
expect(images).toContain('jasmine-horizontal.png');
|
101
|
+
expect(images).toContain('jasmine-horizontal.svg');
|
102
|
+
expect(images).toContain('jasmine_favicon.png');
|
103
|
+
});
|
104
|
+
});
|
data/lib/jasmine-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajan Agaskar
|
8
8
|
- Davis W. Frank
|
9
|
-
-
|
9
|
+
- Gregg Van Hove
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- ./lib/jasmine-core/spec/core/QueueRunnerSpec.js
|
136
136
|
- ./lib/jasmine-core/spec/core/ReportDispatcherSpec.js
|
137
137
|
- ./lib/jasmine-core/spec/core/SpecSpec.js
|
138
|
+
- ./lib/jasmine-core/spec/core/SpyRegistrySpec.js
|
138
139
|
- ./lib/jasmine-core/spec/core/SpySpec.js
|
139
140
|
- ./lib/jasmine-core/spec/core/SpyStrategySpec.js
|
140
141
|
- ./lib/jasmine-core/spec/core/SuiteSpec.js
|
@@ -149,6 +150,8 @@ files:
|
|
149
150
|
- ./lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js
|
150
151
|
- ./lib/jasmine-core/spec/html/QueryStringSpec.js
|
151
152
|
- ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
|
153
|
+
- ./lib/jasmine-core/spec/node_suite.js
|
154
|
+
- ./lib/jasmine-core/spec/npmPackage/npmPackageSpec.js
|
152
155
|
- ./lib/jasmine-core/spec/performance/large_object_test.js
|
153
156
|
- ./lib/jasmine-core/spec/performance/performance_test.js
|
154
157
|
homepage: http://pivotal.github.com/jasmine
|