visionmedia-jspec 2.7.1 → 2.7.2

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,4 +1,11 @@
1
1
 
2
+ === 2.7.2 / 2009-07-24
3
+
4
+ * Fixed "end" in spec bodies when using the grammar
5
+ * Fixed "it" in spec bodies when using the grammar [#142]
6
+ * Changed; HTML entities in descriptions are now escaped for DOM formatter [#141]
7
+ * Added enno84@gmx.net as a contributor (thanks for the bug reports)
8
+
2
9
  === 2.7.1 / 2009-07-17
3
10
 
4
11
  * Changed; hash() now accepts null
data/README.rdoc CHANGED
@@ -634,6 +634,7 @@ JSpec more enjoyable, and bug free ;)
634
634
 
635
635
  * mpd@jesters-court.ne
636
636
  * kevin.gisi@gmail.com
637
+ * enno84@gmx.net
637
638
 
638
639
  == License
639
640
 
data/bin/jspec CHANGED
@@ -11,7 +11,7 @@ require 'fileutils'
11
11
  RHINO = 'java org.mozilla.javascript.tools.shell.Main'
12
12
 
13
13
  program :name, 'JSpec'
14
- program :version, '2.7.1'
14
+ program :version, '2.7.2'
15
15
  program :description, 'JavaScript BDD Testing Framework'
16
16
  default_command :bind
17
17
 
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.7.1"
5
+ s.version = "2.7.2"
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-07-17}
9
+ s.date = %q{2009-07-24}
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}
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Jspec", "--main", "README.rdoc"]
18
18
  s.require_paths = ["lib"]
19
19
  s.rubyforge_project = %q{jspec}
20
- s.rubygems_version = %q{1.3.4}
20
+ s.rubygems_version = %q{1.3.5}
21
21
  s.summary = %q{JavaScript BDD Testing Framework}
22
22
 
23
23
  if s.respond_to? :specification_version then
data/lib/jspec.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  JSpec = {
7
7
 
8
- version : '2.7.1',
8
+ version : '2.7.2',
9
9
  cache : {},
10
10
  suites : [],
11
11
  modules : [],
@@ -118,15 +118,15 @@
118
118
  renderSuite = function(suite) {
119
119
  var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran
120
120
  if (displaySuite && suite.hasSpecs()) {
121
- markup += '<tr class="description"><td colspan="2">' + suite.description + '</td></tr>'
121
+ markup += '<tr class="description"><td colspan="2">' + escape(suite.description) + '</td></tr>'
122
122
  each(suite.specs, function(i, spec){
123
123
  markup += '<tr class="' + (i % 2 ? 'odd' : 'even') + '">'
124
124
  if (spec.requiresImplementation())
125
- markup += '<td class="requires-implementation" colspan="2">' + spec.description + '</td>'
125
+ markup += '<td class="requires-implementation" colspan="2">' + escape(spec.description) + '</td>'
126
126
  else if (spec.passed() && !failuresOnly)
127
- markup += '<td class="pass">' + spec.description+ '</td><td>' + spec.assertionsGraph() + '</td>'
127
+ markup += '<td class="pass">' + escape(spec.description)+ '</td><td>' + spec.assertionsGraph() + '</td>'
128
128
  else if(!spec.passed())
129
- markup += '<td class="fail">' + spec.description + ' <em>' + spec.failure().message + '</em>' + '</td><td>' + spec.assertionsGraph() + '</td>'
129
+ markup += '<td class="fail">' + escape(spec.description) + ' <em>' + spec.failure().message + '</em>' + '</td><td>' + spec.assertionsGraph() + '</td>'
130
130
  markup += '<tr class="body"><td colspan="2"><pre>' + bodyContents(spec.body) + '</pre></td></tr>'
131
131
  })
132
132
  markup += '</tr>'
@@ -1259,9 +1259,9 @@
1259
1259
  return input.
1260
1260
  replace(/([\w\.]+)\.(stub|destub)\((.*?)\)$/gm, '$2($1, $3)').
1261
1261
  replace(/describe\s+(.*?)$/gm, 'describe($1, function(){').
1262
- replace(/\sit\s+(.*?)$/gm, ' it($1, function(){').
1262
+ replace(/^\s+it\s+(.*?)$/gm, ' it($1, function(){').
1263
1263
  replace(/^(?: *)(before_each|after_each|before|after)(?= |\n|$)/gm, 'JSpec.currentSuite.addHook("$1", function(){').
1264
- replace(/\bend(?=\s|$)/gm, '});').
1264
+ replace(/^\s*end(?=\s|$)/gm, '});').
1265
1265
  replace(/-\{/g, 'function(){').
1266
1266
  replace(/(\d+)\.\.(\d+)/g, function(_, a, b){ return range(a, b) }).
1267
1267
  replace(/\.should([_\.]not)?[_\.](\w+)(?: |;|$)(.*)$/gm, '.should$1_$2($3)').
data/spec/spec.grammar.js CHANGED
@@ -11,6 +11,30 @@ describe 'Grammar'
11
11
  n.should.eql 10
12
12
  end
13
13
 
14
+ it 'should escape <html> in <p>descriptions</p> and body'
15
+ '<p></p>'.should.eql '<p></p>'
16
+ end
17
+
18
+ it 'should parse correctly when "it" is within the body'
19
+ text = 'Get it at Github'
20
+ text.should.include 'it'
21
+ end
22
+
23
+ it 'should parse correctly when "describe" is within the body'
24
+ text = 'It should work with describe'
25
+ text.should.include 'describe'
26
+ end
27
+
28
+ it 'should parse correctly when "end" is within the body'
29
+ text = 'This should not end the parsing :)'
30
+ text.should.include 'not'
31
+ end
32
+
33
+ it 'should parse correctly with "before" and "after" within the body'
34
+ text = 'This comes before that, which is after the rest'
35
+ text.should.include 'before'
36
+ end
37
+
14
38
  it 'should allow parens to be optional when no args are passed'
15
39
  true.should.be_true
16
40
  true.should.be_true()
@@ -20,6 +44,10 @@ describe 'Grammar'
20
44
  -{ element.append().end() }.should.throw_error
21
45
  end
22
46
 
47
+ it 'should not mess up "end" in strings'
48
+ 'foo end bar'.should.not.eql 'foo }); bar'
49
+ end
50
+
23
51
  it 'should allow semicolons'
24
52
  true.should.be_true;
25
53
  true.should.be_true();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visionmedia-jspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
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-07-17 00:00:00 -07:00
12
+ date: 2009-07-24 00:00:00 -07:00
13
13
  default_executable: jspec
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency