rspec_junit_formatter 0.3.0.pre → 0.3.0.pre2

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: f06d768eaf9e411ad68a32229073dc7aa32917e1
4
- data.tar.gz: 7d90c8e0eb6e9b786c0a7057f2f6b1645803f685
3
+ metadata.gz: 55b1a8604d34b136f78cd170624c194336f70dfe
4
+ data.tar.gz: 705230520dae4e31e27123d84346224e955729c8
5
5
  SHA512:
6
- metadata.gz: 84ffd05878f6574d9d3e20ed9317432dbfb8f87894d5aa87264048ee8e6cd233b1f61dd28e1b1f5c9b614d7b89bc6e2627855c2cc17fd742492b2c8a2dc3946c
7
- data.tar.gz: 3f9e1f4d8d3cad02103a3cb4a43446ebecc19d207ad891360d997efc2090adf9e82fa67b8db18913d4f74fd20df3855b29fa430aea3288f08b0a69b2c0df7465
6
+ metadata.gz: bc5c46b9898ff49963d616dedd990a2e8500154d2529bad562dc594fd092b4a3684e317d4f5f61e9683992a32184659a869b39a6d879bc0922aff636d7e77ace
7
+ data.tar.gz: 806873dd1a937a4790d7c9a29c29c26c09f9daff03c9cd8bdd47c710775632c8d404533bdf4815d7d2c68988c2cb9f0b2fefc30b085451d4d6cda6cd22de957f
checksums.yaml.gz.sig CHANGED
@@ -1 +1,2 @@
1
- *�h���ƭ�-;3������- a2�b�����ƫN3��64�馒4XQQ(xɡ��*�Q��24�l�&&�_���($����E*ٿy���<����jY]�+�Tp��г��Sbz(����&'�_L��F~�e�Go�ԏ7u �=�}qm����$Ng1�1O��R����������ĵ�4���S~��N{ )ܐՐ�6M;,��b�zc|�����W)3����>E��'��z�А9/�lf��8$%i�-�
1
+ ����������N��[K�QO ��w����Cﷶ�1���"��?��l G�l�kM����p�eJ^\��> t/aF��>k��|�5�3-#���{yB��9" �^�K��W*�t�&���@�cE�G�3�����{���ы��=�Snf���$� N��:Kh0#��|�WV!�O�?Ͱ�{e�C����|%�Uڗ�� 6sײƌh\#9���nG�c�{�@���vR�м
2
+ yM��XGk�
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -42,11 +42,22 @@ end
42
42
 
43
43
  Put the same arguments as the commands above in [your `.rspec`][rspec-file]:
44
44
 
45
- ```
45
+ ```sh
46
46
  --format RspecJunitFormatter
47
47
  --out rspec.xml
48
48
  ```
49
49
 
50
+ ### Parallel tests
51
+
52
+ For use with `parallel_tests`, add `$TEST_ENV_NUMBER` in the output file option (in `.rspec` or `.rspec_parallel`) to avoid concurrent process write conflicts.
53
+
54
+ ```sh
55
+ --format RspecJunitFormatter
56
+ --out tmp/rspec<%= ENV["TEST_ENV_NUMBER"] %>.xml
57
+ ```
58
+
59
+ The formatter includes `$TEST_ENV_NUMBER` in the test suite name within the XML, too.
60
+
50
61
  ## Roadmap
51
62
 
52
63
  * It would be nice to split things up into individual test suites, although
@@ -46,6 +46,18 @@ private
46
46
  exception = exception_for(example)
47
47
  backtrace = format_backtrace(exception.backtrace, example)
48
48
 
49
+ if shared_group = find_shared_group(example)
50
+ backtrace << "Shared Example Group: \"#{shared_group.metadata[:shared_group_name]}\" called from #{shared_group.metadata[:example_group][:location]}"
51
+ end
52
+
49
53
  "#{exception.message}\n#{backtrace.join("\n")}"
50
54
  end
55
+
56
+ def find_shared_group(example)
57
+ group_and_parent_groups(example).find { |group| group.metadata[:shared_group_name] }
58
+ end
59
+
60
+ def group_and_parent_groups(example)
61
+ example.example_group.parent_groups + [example.example_group]
62
+ end
51
63
  end
@@ -44,7 +44,11 @@ private
44
44
  end
45
45
 
46
46
  def example_group_file_path_for(notification)
47
- notification.example.example_group.file_path
47
+ metadata = notification.example.metadata[:example_group]
48
+ while parent_metadata = metadata[:parent_example_group]
49
+ metadata = parent_metadata
50
+ end
51
+ metadata[:file_path]
48
52
  end
49
53
 
50
54
  def classname_for(notification)
@@ -68,3 +72,17 @@ private
68
72
  notification.example.execution_result.exception
69
73
  end
70
74
  end
75
+
76
+ # rspec-core 3.0.x forgot to mark this as a module function which causes:
77
+ #
78
+ # NoMethodError: undefined method `wrap' for RSpec::Core::Notifications::NullColorizer:Class
79
+ # .../rspec-core-3.0.4/lib/rspec/core/notifications.rb:229:in `add_shared_group_line'
80
+ # .../rspec-core-3.0.4/lib/rspec/core/notifications.rb:157:in `message_lines'
81
+ #
82
+ if defined?(RSpec::Core::Notifications::NullColorizer) && RSpec::Core::Notifications::NullColorizer.is_a?(Class) && !RSpec::Core::Notifications::NullColorizer.respond_to?(:wrap)
83
+ RSpec::Core::Notifications::NullColorizer.class_eval do
84
+ def self.wrap(*args)
85
+ new.wrap(*args)
86
+ end
87
+ end
88
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_junit_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre
4
+ version: 0.3.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Cochran
metadata.gz.sig CHANGED
Binary file