jasmine_junitxml_formatter 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 116523ec10aec3fe402767db61d485f779b238b8
4
- data.tar.gz: b306eddedd2e9466d9caf2e0b66d8de2d207d2fa
3
+ metadata.gz: 374cc416fc1bba2c677af48bfdcb327a56e4d8eb
4
+ data.tar.gz: 13e86c5b1c14741d9dfd1a87ba7b5c7d160f8772
5
5
  SHA512:
6
- metadata.gz: 8c640d2772d0d9f9fd8ef85115388213d6a4082a351a003d4ca5594060ed15054dc08e7bc3b40727849c5ae76b9435b143aa5d92203efe11862033145103a26f
7
- data.tar.gz: 6b5af9acd5ec804227ac97162e615a57e4c9bd2f87f848afa1396f7aeb8fa80f30ffc6c6c04f199ecb3a6008de41125ded6cc5975f5412aaae5d3f7b1c98461a
6
+ metadata.gz: ef50fe7131d104d570faae58070e9a1733946972ebe6a183f19bb818194912ee01212c233ff0384203873fc68e8e1857085e8d445dfc118d3f1b7e48dc8a8360
7
+ data.tar.gz: b946e475c29c8d188fe18c80b46f120f4c7553ac95a8b28a6e72c6fa1691445f148a748f1a4a442e3b5b08ba6368932b2373b055ff2d6ed65139646b4c3ca968
@@ -6,4 +6,3 @@ rvm:
6
6
  - "2.0.0"
7
7
  - "2.1.1"
8
8
  - "jruby"
9
- - "rbx-2"
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ gemspec
5
5
  gem 'jasmine', :git => 'https://github.com/pivotal/jasmine-gem.git'
6
6
  # gem 'jasmine', :path => '../jasmine-gem'
7
7
 
8
+ gem 'rack', '< 2.0.0'
@@ -3,6 +3,17 @@ lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'jasmine_junitxml_formatter/version'
5
5
 
6
+ def ruby_version_less_than(target_version)
7
+ version_parts = RUBY_VERSION.split('.').map(&:to_i).zip(target_version)
8
+
9
+ version_parts.each do |(current_part, target_part)|
10
+ if current_part < target_part
11
+ return true
12
+ end
13
+ end
14
+ false
15
+ end
16
+
6
17
  Gem::Specification.new do |spec|
7
18
  spec.name = "jasmine_junitxml_formatter"
8
19
  spec.version = JasmineJunitxmlFormatter::VERSION
@@ -23,5 +34,9 @@ Gem::Specification.new do |spec|
23
34
  spec.add_development_dependency "rake"
24
35
 
25
36
  spec.add_dependency 'jasmine', '~> 2.4'
26
- spec.add_dependency "nokogiri"
37
+ if ruby_version_less_than([2,1,0])
38
+ spec.add_dependency 'nokogiri', '< 1.7.0'
39
+ else
40
+ spec.add_dependency 'nokogiri'
41
+ end
27
42
  end
@@ -8,6 +8,7 @@ module Jasmine
8
8
  @doc = Nokogiri::XML '<testsuites><testsuite name="Jasmine Suite"></testsuite></testsuites>', nil, 'UTF-8'
9
9
  @spec_count = 0
10
10
  @failure_count = 0
11
+ @pending_count = 0
11
12
  end
12
13
 
13
14
  def format(results)
@@ -29,6 +30,10 @@ module Jasmine
29
30
  failure.content = failed_exp.stack
30
31
  failure.parent = testcase
31
32
  end
33
+ elsif result.pending?
34
+ @pending_count += 1
35
+ skipped = Nokogiri::XML::Node.new('skipped', doc)
36
+ skipped.parent = testcase
32
37
  end
33
38
 
34
39
  testcase.parent = testsuite
@@ -1,3 +1,3 @@
1
1
  module JasmineJunitxmlFormatter
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -0,0 +1,10 @@
1
+ # Jasmine JUnit XML Reporter 1.2.0 Release Notes
2
+
3
+ ## Issues and Pull Requests
4
+
5
+ * Support for skipped specs in JUnit output
6
+ - Merges [#6](https://github.com/jasmine/jasmine-npm/issues/6) from @tzar
7
+
8
+ ------
9
+
10
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -48,6 +48,27 @@ describe Jasmine::Formatters::JunitXml do
48
48
  end
49
49
  end
50
50
 
51
+ describe 'when there are pending specs' do
52
+ it "shows the spec counts" do
53
+ results = [pending_result('fullName' => 'Pending test', 'description' => 'test')]
54
+ subject = Jasmine::Formatters::JunitXml.new
55
+
56
+ subject.format(results)
57
+ subject.done({})
58
+ xml = Nokogiri::XML(file_stub.content)
59
+
60
+ testsuite = xml.xpath('/testsuites/testsuite').first
61
+ expect(testsuite['tests']).to eq '1'
62
+ expect(testsuite['failures']).to eq '0'
63
+ expect(testsuite['name']).to eq 'Jasmine Suite'
64
+
65
+ expect(xml.xpath('//testcase').size).to eq 1
66
+ expect(xml.xpath('//testcase').first['classname']).to eq 'Pending'
67
+ expect(xml.xpath('//testcase').first['name']).to eq 'test'
68
+ expect(xml.xpath('//testcase/skipped').first).to_not eq(nil)
69
+ end
70
+ end
71
+
51
72
  describe 'when there are failures' do
52
73
  it 'shows the spec counts' do
53
74
  results1 = [passing_result]
@@ -190,4 +211,8 @@ YAML
190
211
  def passing_result(options = {})
191
212
  Jasmine::Result.new(passing_raw_result.merge(options))
192
213
  end
214
+
215
+ def pending_result(options = {})
216
+ Jasmine::Result.new(pending_raw_result.merge(options))
217
+ end
193
218
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine_junitxml_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Van Hove
@@ -105,6 +105,7 @@ files:
105
105
  - release_notes/0.3.0.md
106
106
  - release_notes/1.0.0.md
107
107
  - release_notes/1.1.0.md
108
+ - release_notes/1.2.0.md
108
109
  - spec/lib/jasmine/formatters/junit_xml_spec.rb
109
110
  - spec/spec_helper.rb
110
111
  homepage: https://github.com/jasmine/jasmine_junitxml_formatter