guard-rspec 4.2.7 → 4.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/guard/rspec/formatter.rb +19 -1
- data/lib/guard/rspec/version.rb +1 -1
- data/spec/lib/guard/rspec/formatter_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWMzMjU3M2I0YjA0Zjk3YWE2ZjVkYTRjODY3ODE0NzYyZGM2NmY1ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGVlZjE4MGQ3ZjA5MmQyM2M1NDU4YWYwYTc4OTc3NWMyODQzYmExMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGYyMDI5NTY4ZjA2MjIzMWFkZGJhNzRjM2MxMWEwNGI0MzA4N2Y0Zjk2NGM0
|
10
|
+
YTJlNWM4NDk4Mjg0NTI4MjBlYWJmYWJlMGJmNGI1MGJiZDgxOWNlNzIwYjlj
|
11
|
+
ZGFhNmM2ZDQ0NmY1NzAwMTMyZmU4Mjc5OGQ2ZmE5NTMyYTc0ZWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjcyNGE3M2FlZGFkYmMyYmZhY2I5MjE3YTZhZTE1NWU4ZWIzYjNkYmQxZDY0
|
14
|
+
ZmJlOTUyZDYwOWMxMTZjZjY1YWM5MzUxYTExY2Y0MjliMDBkMzRhZjA1MmMy
|
15
|
+
OWU0MjM3Y2Q5MDA2OWFlZmU2ODc0NThlZTk2YzE3M2JiMDMxMmI=
|
@@ -6,6 +6,14 @@ module Guard
|
|
6
6
|
class Formatter < ::RSpec::Core::Formatters::BaseFormatter
|
7
7
|
TEMPORARY_FILE_PATH = File.expand_path('./tmp/rspec_guard_result')
|
8
8
|
|
9
|
+
def self.rspec_3?
|
10
|
+
::RSpec::Core::Version::STRING.split('.').first == "3"
|
11
|
+
end
|
12
|
+
|
13
|
+
if rspec_3?
|
14
|
+
::RSpec::Core::Formatters.register self, :dump_summary
|
15
|
+
end
|
16
|
+
|
9
17
|
# rspec issue https://github.com/rspec/rspec-core/issues/793
|
10
18
|
def self.extract_spec_location(metadata)
|
11
19
|
root_metadata = metadata
|
@@ -35,7 +43,17 @@ module Guard
|
|
35
43
|
end
|
36
44
|
|
37
45
|
# Write summary to temporary file for runner
|
38
|
-
def dump_summary(
|
46
|
+
def dump_summary(*args)
|
47
|
+
if self.class.rspec_3?
|
48
|
+
notification = args[0]
|
49
|
+
duration = notification.duration
|
50
|
+
total = notification.example_count
|
51
|
+
failures = notification.failure_count
|
52
|
+
pending = notification.pending_count
|
53
|
+
else
|
54
|
+
duration, total, failures, pending = args
|
55
|
+
end
|
56
|
+
|
39
57
|
write do |f|
|
40
58
|
f.puts _message(total, failures, pending, duration)
|
41
59
|
f.puts _failed_paths.join("\n") if failures > 0
|
data/lib/guard/rspec/version.rb
CHANGED
@@ -60,6 +60,20 @@ describe Guard::RSpec::Formatter do
|
|
60
60
|
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
|
61
61
|
end
|
62
62
|
|
63
|
+
context "for rspec 3" do
|
64
|
+
let(:notification) {
|
65
|
+
Struct.new(:duration, :example_count, :failure_count, :pending_count).new(123, 3, 1, 0)
|
66
|
+
}
|
67
|
+
before do
|
68
|
+
formatter.class.stub(:rspec_3?).and_return(true)
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'writes summary line and failed location' do
|
72
|
+
allow(formatter).to receive(:examples) { [failed_example] }
|
73
|
+
formatter.dump_summary(notification)
|
74
|
+
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
|
75
|
+
end
|
76
|
+
end
|
63
77
|
end
|
64
78
|
|
65
79
|
it 'should find the spec file for shared examples' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibaud Guillaume-Gentil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|