jspec 2.11.10 → 2.11.12

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.
data/History.rdoc CHANGED
@@ -1,8 +1,25 @@
1
1
 
2
+ === 2.11.12 / 2009-11-12
3
+
4
+ * Changed; DOM formatter displaying several failure messages when present [#89]
5
+ * Changed; displaying multiple error messages for Terminal formatter
6
+ * Updated mock timers to 1.0.2
7
+ * Fixed receive matcher negation issue with the number of times called [#150]
8
+
9
+ === 2.11.11 / 2009-10-23
10
+
11
+ * Added cheat sheet install docs
12
+ * Added Google Group link
13
+ * Added sarah to contrib list
14
+ * Changed Terminal formatter's java.lang.System.exit() -> quit()
15
+ * Removed unnecessary flags from several regexps
16
+ * Fixed DOM paths when using --freeze [#88]
17
+ * Fixed __END__
18
+
2
19
  === 2.11.10 / 2009-10-19
3
20
 
4
- * Fixed exit status with Terminal reporter [#77] [thanks darxriggs for reporting]
5
- This is now fixed when using `jspec run --rhino` as well as `java -jar js.jar spec/spec.rhino.js`.
21
+ * Fixed exit status with Terminal reporter [#77] [thanks darxriggs for reporting]
22
+ This is now fixed when using `jspec run --rhino` as well as `java -jar js.jar spec/spec.rhino.js`.
6
23
 
7
24
  === 2.11.9 / 2009-10-16
8
25
 
data/README.rdoc CHANGED
@@ -77,6 +77,13 @@ You may optionally want to use sources in the /pkg directory
77
77
  for your project, since it includes compressed alternatives generated
78
78
  each release.
79
79
 
80
+ == Cheat Sheet
81
+
82
+ Using the bash cheat sheet library found at http://github.com/visionmedia/ch
83
+ we can get quick cheat sheets for many aspects of development including JSpec!
84
+
85
+ $ cd /tmp && git clone git://github.com/visionmedia/ch.git && cd ch && sudo make install && ch jspec
86
+
80
87
  == Example
81
88
 
82
89
  describe 'ShoppingCart'
@@ -437,6 +444,15 @@ These are equivalent:
437
444
  The following expands to the array of [1,2,3,4,5]
438
445
 
439
446
  n.should.be_within 1..5
447
+
448
+ === __END__
449
+
450
+ Any text placed after __END__ is considered irrelevant and
451
+ is striped out before evaluation. This is sometimes useful for
452
+ document or code reference while writing specs.
453
+
454
+ For example when writting regression specs it is sometimes useful
455
+ to paste the issue ticket's comment(s) below this area for reference.
440
456
 
441
457
  == Formatters
442
458
 
@@ -774,6 +790,7 @@ your spec/server.rb file may support additional browsers.
774
790
 
775
791
  == More Information
776
792
 
793
+ * Google Group http://groups.google.com/group/jspec
777
794
  * IRC Channel irc://irc.freenode.net#jspec
778
795
  * Featured article in JSMag: http://www.jsmag.com/main.issues.description/id=21/
779
796
  * Syntax comparison with other frameworks http://gist.github.com/92283
data/bin/jspec CHANGED
@@ -12,7 +12,7 @@ require 'server/server'
12
12
  RHINO = 'java org.mozilla.javascript.tools.shell.Main'
13
13
 
14
14
  program :name, 'JSpec'
15
- program :version, '2.11.10'
15
+ program :version, '2.11.12'
16
16
  program :description, 'JavaScript BDD Testing Framework'
17
17
  default_command :bind
18
18
 
@@ -258,7 +258,11 @@ def replace_root_in dest, *paths
258
258
 
259
259
  paths.each do |path|
260
260
  path = File.join dest, path
261
- contents = File.read(path).gsub 'JSPEC_ROOT', root
261
+ if path.include? 'dom'
262
+ contents = File.read(path).gsub 'JSPEC_ROOT/', ''
263
+ else
264
+ contents = File.read(path).gsub 'JSPEC_ROOT', root
265
+ end
262
266
  File.open(path, 'w') { |file| file.write contents }
263
267
  end
264
268
  end
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 = "2.11.10"
5
+ s.version = "2.11.12"
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{2009-10-19}
9
+ s.date = %q{2009-11-12}
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.css CHANGED
@@ -95,6 +95,8 @@ body.jspec {
95
95
  display: block;
96
96
  }
97
97
  #jspec-report tr td:first-child em {
98
+ display: block;
99
+ clear: both;
98
100
  font-style: normal;
99
101
  font-weight: normal;
100
102
  color: #7B8D9B;
data/lib/jspec.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  JSpec = {
7
7
 
8
- version : '2.11.10',
8
+ version : '2.11.12',
9
9
  cache : {},
10
10
  suites : [],
11
11
  modules : [],
@@ -160,7 +160,9 @@
160
160
  (spec.passed() && !failuresOnly) ?
161
161
  '<td class="pass">' + escape(spec.description)+ '</td><td>' + spec.assertionsGraph() + '</td>' :
162
162
  !spec.passed() ?
163
- '<td class="fail">' + escape(spec.description) + ' <em>' + escape(spec.failure().message) + '</em>' + '</td><td>' + spec.assertionsGraph() + '</td>' :
163
+ '<td class="fail">' + escape(spec.description) +
164
+ map(spec.failures(), function(a){ return '<em>' + escape(a.message) + '</em>' }).join('') +
165
+ '</td><td>' + spec.assertionsGraph() + '</td>' :
164
166
  '') +
165
167
  '<tr class="body"><td colspan="2"><pre>' + bodyContents(spec.body) + '</pre></td></tr>'
166
168
  }).join('') + '</tr>'
@@ -196,7 +198,7 @@
196
198
  print(color(' ' + spec.description, 'green') + assertionsGraph)
197
199
  else if (!spec.passed())
198
200
  print(color(' ' + spec.description, 'red') + assertionsGraph +
199
- "\n" + indent(spec.failure().message) + "\n")
201
+ "\n" + indent(map(spec.failures(), function(a){ return a.message }).join("\n")) + "\n")
200
202
  })
201
203
  print("")
202
204
  }
@@ -399,7 +401,7 @@
399
401
  this.message = methodString + ' to be called with ' + puts.apply(this, this.expectedArgs) +
400
402
  ' but was' + (negate ? '' : ' called with ' + puts.apply(this, this.failingArgs()))
401
403
 
402
- if (negate ? !this.expectedResult && !this.expectedArgs && this.calls.length == this.times : this.calls.length != this.times)
404
+ if (negate ? !this.expectedResult && !this.expectedArgs && this.calls.length >= this.times : this.calls.length != this.times)
403
405
  this.message = methodString + ' to be called ' + times(this.times) +
404
406
  ', but ' + (this.calls.length == 0 ? ' was not called' : ' was called ' + times(this.calls.length))
405
407
 
@@ -1340,8 +1342,9 @@
1340
1342
  if (typeof input != 'string') return
1341
1343
  input = hookImmutable('preprocessing', input)
1342
1344
  return input.
1343
- replace(/\t/gm, ' ').
1344
- replace(/\r\n|\n|\r/gm, '\n').
1345
+ replace(/\t/g, ' ').
1346
+ replace(/\r\n|\n|\r/g, '\n').
1347
+ replace(/__END__[^]*/, '').
1345
1348
  replace(/([\w\.]+)\.(stub|destub)\((.*?)\)$/gm, '$2($1, $3)').
1346
1349
  replace(/describe\s+(.*?)$/gm, 'describe($1, function(){').
1347
1350
  replace(/^\s+it\s+(.*?)$/gm, ' it($1, function(){').
@@ -1351,9 +1354,8 @@
1351
1354
  replace(/(\d+)\.\.(\d+)/g, function(_, a, b){ return range(a, b) }).
1352
1355
  replace(/\.should([_\.]not)?[_\.](\w+)(?: |;|$)(.*)$/gm, '.should$1_$2($3)').
1353
1356
  replace(/([\/\s]*)(.+?)\.(should(?:[_\.]not)?)[_\.](\w+)\((.*)\)\s*;?$/gm, '$1 expect($2).$3($4, $5)').
1354
- replace(/, \)/gm, ')').
1355
- replace(/should\.not/gm, 'should_not').
1356
- replace(/__END__.*/m, '')
1357
+ replace(/, \)/g, ')').
1358
+ replace(/should\.not/g, 'should_not')
1357
1359
  },
1358
1360
 
1359
1361
  /**
data/lib/jspec.timers.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- // JSpec - Mock Timers - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
2
+ // Mock Timers - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
3
3
 
4
4
  ;(function(){
5
5
 
@@ -7,7 +7,7 @@
7
7
  * Version.
8
8
  */
9
9
 
10
- mockTimersVersion = '1.0.1'
10
+ mockTimersVersion = '1.0.2'
11
11
 
12
12
  /**
13
13
  * Localized timer stack.
@@ -54,7 +54,7 @@
54
54
  * @api public
55
55
  */
56
56
 
57
- clearInterval = function(id) {
57
+ clearInterval = clearTimeout = function(id) {
58
58
  return delete timers[--id]
59
59
  }
60
60
 
data/spec/spec.grammar.js CHANGED
@@ -121,6 +121,16 @@ describe 'Grammar'
121
121
  true.should.be(true);
122
122
  end
123
123
  end
124
+
125
+ describe "with some tabs"
126
+ before_each
127
+ foo = 'baz'
128
+ end
129
+
130
+ it 'should work'
131
+ foo.should.eql 'baz'
132
+ end
133
+ end
124
134
 
125
135
  describe 'with nested describe'
126
136
  it 'should work'
@@ -235,8 +245,7 @@ end
235
245
 
236
246
  __END__
237
247
 
238
- describe 'Grammar'
239
- it 'should consider everything below __END__ a comment'
240
-
241
- end
242
- end
248
+ this should not matter because it is
249
+ considered a comment by the JSpec grammar :)
250
+ and is sometimes useful for temp reference info
251
+ when writting specs.
@@ -456,10 +456,23 @@ describe 'Matchers'
456
456
  personWithPets.addPets('izzy')
457
457
  end
458
458
 
459
- it 'should fail with negation with times'
460
- personWithPets.should.not.receive('addPets', 'twice')
459
+ it 'should fail with negation when called once with no times specified'
460
+ personWithPets.should.not.receive('addPets')
461
+ personWithPets.addPets('izzy')
462
+ end
463
+
464
+ it 'should fail with negation when called more than once with no times specified'
465
+ personWithPets.should.not.receive('addPets')
466
+ personWithPets.addPets('izzy')
467
+ personWithPets.addPets('izzy')
468
+ end
469
+
470
+ it 'should fail with negation when called more than the times specified'
471
+ personWithPets.should.not.receive('addPets', 3)
472
+ personWithPets.addPets('izzy')
473
+ personWithPets.addPets('izzy')
474
+ personWithPets.addPets('izzy')
461
475
  personWithPets.addPets('izzy')
462
- personWithPets.addPets('max')
463
476
  end
464
477
 
465
478
  it 'should fail with boolean args'
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: 2.11.10
4
+ version: 2.11.12
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: 2009-10-19 00:00:00 -07:00
12
+ date: 2009-11-12 00:00:00 -08:00
13
13
  default_executable: jspec
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency