gorgon 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/gorgon/gorgon_rspec_formatter.rb +26 -17
- data/lib/gorgon/rspec_runner.rb +1 -0
- data/lib/gorgon/version.rb +1 -1
- data/spec/gorgon_rspec_formatter_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGZiMzQ4NmM4NWFmMTQ3Y2U3MzU4NDQxYjc3NDgzM2RmMTM1OWUyYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGNlMDc1OWM5ZmFkMjdjZmUxYmJmMDM0NmNlYWFkNDA1NDBiYzRhNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDRjZGQ3ZmU5YmVjMTAwZDcyNDM4ZDMwYjcyYWQ4N2JhMzA4MTA3N2ZkY2U4
|
10
|
+
ZTRlNjgxZWUzOGQ0MDg3NDQ0YTEwNDQwZWVjOWExYjU1MWIyYmRkN2RkMzg3
|
11
|
+
MTE1OWNmMWI1NDAxMTNmM2ZiZWVlZjQyNWZjNzIzMzA2YzUxZDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGI1OGEzZjA5YmFlZDFlOWIxNWEwMDAxYTI5NDQ3ZDcyYzVkODU4Zjk4NjYy
|
14
|
+
MGM1N2I2N2E3OTRkNGYxMDI3YWUwNWExYmVlZWRmYzBiOTMwNGM5MjMxMzU1
|
15
|
+
ZmZiN2EyMGFjMDlmZDkyYTlmNzVhNTM1OTdmNTBlODEyMzZjMmM=
|
data/Gemfile.lock
CHANGED
@@ -5,6 +5,10 @@ module RSpec
|
|
5
5
|
module Core
|
6
6
|
module Formatters
|
7
7
|
class GorgonRspecFormatter < BaseFormatter
|
8
|
+
if Formatters.respond_to? :register
|
9
|
+
Formatters.register self, :message, :stop, :close
|
10
|
+
end
|
11
|
+
|
8
12
|
attr_reader :output
|
9
13
|
|
10
14
|
def initialize(output)
|
@@ -16,30 +20,35 @@ module RSpec
|
|
16
20
|
@failures += message unless @failures.empty?
|
17
21
|
end
|
18
22
|
|
19
|
-
def stop
|
20
|
-
|
21
|
-
failures = examples.select { |e| e.execution_result[:status] == "failed" }
|
22
|
-
|
23
|
-
@failures += failures.map do |failure|
|
23
|
+
def stop(notification=nil)
|
24
|
+
@failures += failures(notification).map do |failure|
|
24
25
|
{
|
25
|
-
:
|
26
|
-
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:line_number => failure.metadata[:line_number],
|
26
|
+
test_name: "#{failure.full_description}: line #{failure.metadata[:line_number]}",
|
27
|
+
description: failure.description,
|
28
|
+
full_description: failure.full_description,
|
29
|
+
status: :failed,
|
30
|
+
file_path: failure.metadata[:file_path],
|
31
|
+
line_number: failure.metadata[:line_number],
|
32
32
|
}.tap do |hash|
|
33
|
-
|
34
|
-
|
35
|
-
hash[:
|
36
|
-
hash[:
|
33
|
+
exception = failure.exception
|
34
|
+
unless exception.nil?
|
35
|
+
hash[:class] = exception.class.name
|
36
|
+
hash[:message] = exception.message
|
37
|
+
hash[:location] = exception.backtrace
|
37
38
|
end
|
38
39
|
end
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
42
|
-
def
|
43
|
+
def failures(notification)
|
44
|
+
if !notification.nil?
|
45
|
+
notification.examples.select { |e| e.execution_result.status == :failed }
|
46
|
+
else
|
47
|
+
examples.select { |e| e.execution_result[:status] == "failed" }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def close(_notification=nil)
|
43
52
|
output.write @failures.to_json
|
44
53
|
output.close if IO === output && output != $stdout
|
45
54
|
end
|
data/lib/gorgon/rspec_runner.rb
CHANGED
data/lib/gorgon/version.rb
CHANGED
@@ -60,4 +60,16 @@ describe RSpec::Core::Formatters::GorgonRspecFormatter do
|
|
60
60
|
@formatter.stop
|
61
61
|
@formatter.close
|
62
62
|
end
|
63
|
+
|
64
|
+
it "uses RSpec 3 API when available" do
|
65
|
+
fail_example.execution_result.should_receive(:status).and_return(:failed)
|
66
|
+
notification = double(examples: [fail_example])
|
67
|
+
|
68
|
+
expected_result = [{:test_name => "Full_Description: line 2", :description => "description",
|
69
|
+
:full_description => "Full_Description", :status => "failed",
|
70
|
+
:file_path => "path/to/file", :line_number => 2}]
|
71
|
+
output.should_receive(:write).with(expected_result.to_json)
|
72
|
+
@formatter.stop(notification)
|
73
|
+
@formatter.close
|
74
|
+
end
|
63
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorgon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Fitzsimmons
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-05-
|
15
|
+
date: 2015-05-24 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|