jspec 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +9 -0
- data/README.md +2 -2
- data/jspec.gemspec +2 -2
- data/lib/jspec.js +29 -37
- data/lib/jspec.xhr.js +2 -0
- data/spec/node.js +0 -14
- data/spec/rhino.js +0 -1
- data/src/browsers.rb +4 -6
- data/templates/default/spec/node.js +0 -14
- metadata +2 -2
data/History.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
|
2
|
+
3.3.0 / 2010-02-16
|
3
|
+
==================
|
4
|
+
|
5
|
+
* Added support for Chrome on Linux [alex-bepple]
|
6
|
+
* Added node.js support in core, no longer has node-specific code in template
|
7
|
+
* Fixed linux Default browser support, use 'xdg-open' [alex-bepple]
|
8
|
+
* Fixed lastRequest global
|
9
|
+
* Removed Console reporter. Closes #142
|
10
|
+
|
2
11
|
3.2.1 / 2010-02-02
|
3
12
|
==================
|
4
13
|
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ and **much more**.
|
|
24
24
|
* Extremely simple and intuitive matcher declaration
|
25
25
|
* Over 45 core matchers
|
26
26
|
* Allows parens to be optional when using matchers to increase readability
|
27
|
-
* Several helpful reporters (DOM,
|
27
|
+
* Several helpful reporters (DOM, Terminal, ...)
|
28
28
|
* Assertion graphs displaying how many, and which assertions pass or failed
|
29
29
|
* Default / customizable evaluation contexts
|
30
30
|
* DOM sandbox support
|
@@ -519,7 +519,7 @@ to paste the issue ticket's comment(s) below this area for reference.
|
|
519
519
|
To change a reporter simply alter the options hash like below, assigning
|
520
520
|
a new constructor, or pass it within the hash to `run()`:
|
521
521
|
|
522
|
-
JSpec.options.reporter = JSpec.reporters.
|
522
|
+
JSpec.options.reporter = JSpec.reporters.Terminal
|
523
523
|
|
524
524
|
OR
|
525
525
|
|
data/jspec.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{jspec}
|
5
|
-
s.version = "3.
|
5
|
+
s.version = "3.3.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["TJ Holowaychuk"]
|
9
|
-
s.date = %q{2010-02-
|
9
|
+
s.date = %q{2010-02-16}
|
10
10
|
s.default_executable = %q{jspec}
|
11
11
|
s.description = %q{JavaScript BDD Testing Framework}
|
12
12
|
s.email = %q{tj@vision-media.ca}
|
data/lib/jspec.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
;(function(){
|
5
5
|
|
6
6
|
JSpec = {
|
7
|
-
version : '3.
|
7
|
+
version : '3.3.0',
|
8
8
|
assert : true,
|
9
9
|
cache : {},
|
10
10
|
suites : [],
|
@@ -126,10 +126,10 @@
|
|
126
126
|
*/
|
127
127
|
|
128
128
|
DOM : function(results, options) {
|
129
|
-
var id = option('reportToId') || 'jspec'
|
130
|
-
|
131
|
-
|
132
|
-
|
129
|
+
var id = option('reportToId') || 'jspec',
|
130
|
+
report = document.getElementById(id),
|
131
|
+
failuresOnly = option('failuresOnly'),
|
132
|
+
classes = results.stats.failures ? 'has-failures' : ''
|
133
133
|
if (!report) throw 'JSpec requires the element #' + id + ' to output its reports'
|
134
134
|
|
135
135
|
function bodyContents(body) {
|
@@ -170,7 +170,7 @@
|
|
170
170
|
*/
|
171
171
|
|
172
172
|
Terminal : function(results, options) {
|
173
|
-
failuresOnly = option('failuresOnly')
|
173
|
+
var failuresOnly = option('failuresOnly')
|
174
174
|
print(color("\n Passes: ", 'bold') + color(results.stats.passes, 'green') +
|
175
175
|
color(" Failures: ", 'bold') + color(results.stats.failures, 'red') +
|
176
176
|
color(" Duration: ", 'bold') + color(results.duration, 'green') + " ms \n")
|
@@ -200,33 +200,7 @@
|
|
200
200
|
})
|
201
201
|
|
202
202
|
quit(results.stats.failures)
|
203
|
-
}
|
204
|
-
|
205
|
-
/**
|
206
|
-
* Console reporter.
|
207
|
-
*
|
208
|
-
* @api public
|
209
|
-
*/
|
210
|
-
|
211
|
-
Console : function(results, options) {
|
212
|
-
console.log('')
|
213
|
-
console.log('Passes: ' + results.stats.passes + ' Failures: ' + results.stats.failures)
|
214
|
-
each(results.allSuites, function(suite) {
|
215
|
-
if (suite.ran) {
|
216
|
-
console.group(suite.description)
|
217
|
-
each(suite.specs, function(spec){
|
218
|
-
var assertionCount = spec.assertions.length + ':'
|
219
|
-
if (spec.requiresImplementation())
|
220
|
-
console.warn(spec.description)
|
221
|
-
else if (spec.passed())
|
222
|
-
console.log(assertionCount + ' ' + spec.description)
|
223
|
-
else
|
224
|
-
console.error(assertionCount + ' ' + spec.description + ', ' + spec.failure().message)
|
225
|
-
})
|
226
|
-
console.groupEnd()
|
227
|
-
}
|
228
|
-
})
|
229
|
-
}
|
203
|
+
}
|
230
204
|
},
|
231
205
|
|
232
206
|
Assertion : function(matcher, actual, expected, negate) {
|
@@ -1637,12 +1611,30 @@
|
|
1637
1611
|
return this
|
1638
1612
|
}
|
1639
1613
|
}
|
1640
|
-
|
1614
|
+
|
1615
|
+
// --- Node.js support
|
1616
|
+
|
1617
|
+
if (typeof GLOBAL === 'object' && typeof exports === 'object') {
|
1618
|
+
var posix = require('posix')
|
1619
|
+
quit = process.exit
|
1620
|
+
print = require('sys').puts
|
1621
|
+
|
1622
|
+
readFile = function(path) {
|
1623
|
+
var result
|
1624
|
+
posix
|
1625
|
+
.cat(path, "utf8")
|
1626
|
+
.addCallback(function(contents){ result = contents })
|
1627
|
+
.addErrback(function(){ throw new Error("failed to read file `" + path + "'") })
|
1628
|
+
.wait()
|
1629
|
+
return result
|
1630
|
+
}
|
1631
|
+
}
|
1632
|
+
|
1641
1633
|
// --- Utility functions
|
1642
1634
|
|
1643
|
-
var main = this
|
1644
|
-
|
1645
|
-
|
1635
|
+
var main = this,
|
1636
|
+
find = JSpec.any,
|
1637
|
+
utils = 'haveStopped stub hookImmutable hook destub map any last pass fail range each option inject select \
|
1646
1638
|
error escape extend puts query strip color does addMatchers callIterator toArray equal'.split(/\s+/)
|
1647
1639
|
while (utils.length) eval('var ' + utils[0] + ' = JSpec.' + utils.shift())
|
1648
1640
|
if (!main.setTimeout) main.setTimeout = function(callback){ callback() }
|
data/lib/jspec.xhr.js
CHANGED
data/spec/node.js
CHANGED
@@ -1,23 +1,9 @@
|
|
1
1
|
|
2
2
|
require.paths.unshift('./lib', './spec');
|
3
|
-
process.mixin(require('sys'))
|
4
3
|
|
5
4
|
require("jspec")
|
6
5
|
require("unit/helpers")
|
7
6
|
|
8
|
-
quit = process.exit
|
9
|
-
print = puts
|
10
|
-
|
11
|
-
readFile = function(path) {
|
12
|
-
var result
|
13
|
-
require('posix')
|
14
|
-
.cat(path, "utf8")
|
15
|
-
.addCallback(function(contents){ result = contents })
|
16
|
-
.addErrback(function(){ throw new Error("failed to read file `" + path + "'") })
|
17
|
-
.wait()
|
18
|
-
return result
|
19
|
-
}
|
20
|
-
|
21
7
|
JSpec
|
22
8
|
.exec('spec/unit/spec.js')
|
23
9
|
.exec('spec/unit/spec.utils.js')
|
data/spec/rhino.js
CHANGED
data/src/browsers.rb
CHANGED
@@ -32,7 +32,7 @@ class Browser
|
|
32
32
|
end
|
33
33
|
|
34
34
|
##
|
35
|
-
#
|
35
|
+
# Whether or not the browser is supported.
|
36
36
|
|
37
37
|
def supported?; true end
|
38
38
|
|
@@ -94,10 +94,7 @@ class Browser
|
|
94
94
|
def visit uri
|
95
95
|
system 'open', uri if macos?
|
96
96
|
system 'start', uri if windows?
|
97
|
-
|
98
|
-
|
99
|
-
def supported?
|
100
|
-
macos?
|
97
|
+
system 'xdg-open', uri if linux?
|
101
98
|
end
|
102
99
|
|
103
100
|
def to_s
|
@@ -177,11 +174,12 @@ class Browser
|
|
177
174
|
end
|
178
175
|
|
179
176
|
def supported?
|
180
|
-
macos?
|
177
|
+
macos? or linux?
|
181
178
|
end
|
182
179
|
|
183
180
|
def visit uri
|
184
181
|
system "open -g -a 'Google Chrome' #{uri}" if macos?
|
182
|
+
system "google-chrome #{uri}" if linux?
|
185
183
|
end
|
186
184
|
|
187
185
|
def to_s
|
@@ -1,23 +1,9 @@
|
|
1
1
|
|
2
|
-
process.mixin(require('sys'))
|
3
2
|
require.paths.unshift('spec', 'JSPEC_ROOT/lib', 'lib')
|
4
3
|
require('jspec')
|
5
4
|
require('unit/spec.helper')
|
6
5
|
require('yourlib')
|
7
6
|
|
8
|
-
quit = process.exit
|
9
|
-
print = puts
|
10
|
-
|
11
|
-
readFile = function(path) {
|
12
|
-
var result
|
13
|
-
require('posix')
|
14
|
-
.cat(path, "utf8")
|
15
|
-
.addCallback(function(contents){ result = contents })
|
16
|
-
.addErrback(function(){ throw new Error("failed to read file `" + path + "'") })
|
17
|
-
.wait()
|
18
|
-
return result
|
19
|
-
}
|
20
|
-
|
21
7
|
JSpec
|
22
8
|
.exec('spec/unit/spec.js')
|
23
9
|
.run({ reporter: JSpec.reporters.Terminal, fixturePath: 'spec/fixtures' })
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Holowaychuk
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-16 00:00:00 -08:00
|
13
13
|
default_executable: jspec
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|