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 +4 -4
- checksums.yaml.gz.sig +2 -1
- data.tar.gz.sig +0 -0
- data/README.md +12 -1
- data/lib/rspec_junit_formatter/rspec2.rb +12 -0
- data/lib/rspec_junit_formatter/rspec3.rb +19 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55b1a8604d34b136f78cd170624c194336f70dfe
|
4
|
+
data.tar.gz: 705230520dae4e31e27123d84346224e955729c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc5c46b9898ff49963d616dedd990a2e8500154d2529bad562dc594fd092b4a3684e317d4f5f61e9683992a32184659a869b39a6d879bc0922aff636d7e77ace
|
7
|
+
data.tar.gz: 806873dd1a937a4790d7c9a29c29c26c09f9daff03c9cd8bdd47c710775632c8d404533bdf4815d7d2c68988c2cb9f0b2fefc30b085451d4d6cda6cd22de957f
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
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ڗ��6�sײƌ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
|
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
metadata.gz.sig
CHANGED
Binary file
|