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 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, Console, Terminal, ...)
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.Console
522
+ JSpec.options.reporter = JSpec.reporters.Terminal
523
523
 
524
524
  OR
525
525
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{jspec}
5
- s.version = "3.2.1"
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-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}
@@ -4,7 +4,7 @@
4
4
  ;(function(){
5
5
 
6
6
  JSpec = {
7
- version : '3.2.1',
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
- var report = document.getElementById(id)
131
- var failuresOnly = option('failuresOnly')
132
- var classes = results.stats.failures ? 'has-failures' : ''
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
- var find = JSpec.any
1645
- var utils = 'haveStopped stub hookImmutable hook destub map any last pass fail range each option inject select \
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() }
@@ -3,6 +3,8 @@
3
3
 
4
4
  (function(){
5
5
 
6
+ var lastRequest
7
+
6
8
  // --- Original XMLHttpRequest
7
9
 
8
10
  var OriginalXMLHttpRequest = 'XMLHttpRequest' in this ?
@@ -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')
@@ -4,7 +4,6 @@ Envjs('spec/fixtures/test.html')
4
4
  load('spec/support/jquery.js')
5
5
  load('lib/jspec.js')
6
6
  load('lib/jspec.xhr.js')
7
- load('lib/jspec.growl.js')
8
7
  load('lib/jspec.jquery.js')
9
8
  load('spec/unit/helpers.js')
10
9
  load('spec/unit/spec.grammar-less.js')
@@ -32,7 +32,7 @@ class Browser
32
32
  end
33
33
 
34
34
  ##
35
- # Weither or not the browser is supported.
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
- end
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.2.1
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-02 00:00:00 -08:00
12
+ date: 2010-02-16 00:00:00 -08:00
13
13
  default_executable: jspec
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency