guard-rspec 4.2.8 → 4.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +1 -1
- data/.travis.yml +4 -1
- data/gemfiles/Gemfile.rspec-2.14 +13 -0
- data/gemfiles/Gemfile.rspec-3.0 +13 -0
- data/lib/guard/rspec/formatter.rb +15 -11
- data/lib/guard/rspec/version.rb +1 -1
- data/spec/lib/guard/rspec/formatter_spec.rb +8 -8
- data/spec/lib/guard/rspec/runner_spec.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTRhM2FmMGVmNTRlOGVmMGExZDg2OGRiMGQwMDI0Y2I5OGNjNDBmZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjI0OTI0ODkwNjUxNjhhYTJjZmZhMmMxZGZlNzU5ODU3YmRmZWNkMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGQxMmRkM2I5NzViMjMwYTgwYTlhYjE5Y2M0NTgwMDZlZDUyOTAyODBkNzcw
|
10
|
+
N2JlNmE5YjM1ODgxOWQxYWIyOWI0ZTgyMzE4MWU3YmNlMTViYWUyYTU3ZDcw
|
11
|
+
YzY2ZWJhNzIyZGI2Nzg1ODFlMTNmNGNmYWI5MjRmODY3YzA5YTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjRmOGZjOTc4MWQwNmFlNjRiNzNiNTdmNTFlOTUzMWM2NTBhYWQ2YjUwYjhl
|
14
|
+
Yjc5OGIxNDcyNjZjYjNmZDU1MzlmNmMxMjgxMzY5NDJhODg3OWU2MjlhMzdl
|
15
|
+
MTg0N2JjNjc5NTNmM2Y1MWFiNWEwNjEyNDc2NzMwOGZiNjA4OWI=
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -6,10 +6,13 @@ rvm:
|
|
6
6
|
- 2.1.0
|
7
7
|
- jruby-19mode
|
8
8
|
- rbx
|
9
|
+
gemfile:
|
10
|
+
- gemfiles/Gemfile.rspec-2.14
|
11
|
+
- gemfiles/Gemfile.rspec-3.0
|
9
12
|
matrix:
|
10
13
|
allow_failures:
|
11
14
|
- rvm: jruby-19mode
|
12
15
|
- rvm: rbx
|
13
16
|
notifications:
|
14
17
|
recipients:
|
15
|
-
- thibaud@thibaud.
|
18
|
+
- thibaud@thibaud.gg
|
@@ -4,7 +4,7 @@ require 'rspec/core/formatters/base_formatter'
|
|
4
4
|
module Guard
|
5
5
|
class RSpec
|
6
6
|
class Formatter < ::RSpec::Core::Formatters::BaseFormatter
|
7
|
-
TEMPORARY_FILE_PATH
|
7
|
+
TEMPORARY_FILE_PATH ||= File.expand_path('./tmp/rspec_guard_result')
|
8
8
|
|
9
9
|
def self.rspec_3?
|
10
10
|
::RSpec::Core::Version::STRING.split('.').first == "3"
|
@@ -42,29 +42,33 @@ module Guard
|
|
42
42
|
File.fnmatch(::RSpec.configuration.pattern, path.sub(/:\d+\z/, ''), flags)
|
43
43
|
end
|
44
44
|
|
45
|
-
# Write summary to temporary file for runner
|
46
45
|
def dump_summary(*args)
|
47
46
|
if self.class.rspec_3?
|
48
47
|
notification = args[0]
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
write_summary(
|
49
|
+
notification.duration,
|
50
|
+
notification.example_count,
|
51
|
+
notification.failure_count,
|
52
|
+
notification.pending_count
|
53
|
+
)
|
53
54
|
else
|
54
|
-
|
55
|
+
write_summary(*args)
|
55
56
|
end
|
57
|
+
rescue
|
58
|
+
# nothing really we can do, at least don't kill the test runner
|
59
|
+
end
|
56
60
|
|
57
|
-
|
61
|
+
# Write summary to temporary file for runner
|
62
|
+
def write_summary(duration, total, failures, pending)
|
63
|
+
_write do |f|
|
58
64
|
f.puts _message(total, failures, pending, duration)
|
59
65
|
f.puts _failed_paths.join("\n") if failures > 0
|
60
66
|
end
|
61
|
-
rescue
|
62
|
-
# nothing really we can do, at least don't kill the test runner
|
63
67
|
end
|
64
68
|
|
65
69
|
private
|
66
70
|
|
67
|
-
def
|
71
|
+
def _write(&block)
|
68
72
|
FileUtils.mkdir_p(File.dirname(TEMPORARY_FILE_PATH))
|
69
73
|
File.open(TEMPORARY_FILE_PATH, 'w', &block)
|
70
74
|
end
|
data/lib/guard/rspec/version.rb
CHANGED
@@ -6,17 +6,17 @@ describe Guard::RSpec::Formatter do
|
|
6
6
|
it 'is absolute path' do
|
7
7
|
require 'pathname'
|
8
8
|
temporary_file_path = described_class.const_get(:TEMPORARY_FILE_PATH)
|
9
|
-
expect(Pathname.new(temporary_file_path).absolute?).to
|
9
|
+
expect(Pathname.new(temporary_file_path).absolute?).to eq(true)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
describe '#
|
13
|
+
describe '#write_summary' do
|
14
14
|
let(:writer) {
|
15
15
|
StringIO.new
|
16
16
|
}
|
17
17
|
let(:formatter) {
|
18
18
|
Guard::RSpec::Formatter.new(StringIO.new).tap do |formatter|
|
19
|
-
formatter.stub(:
|
19
|
+
formatter.stub(:_write) do |&block|
|
20
20
|
block.call writer
|
21
21
|
end
|
22
22
|
end
|
@@ -35,7 +35,7 @@ describe Guard::RSpec::Formatter do
|
|
35
35
|
temporary_file_path = described_class.const_get(:TEMPORARY_FILE_PATH)
|
36
36
|
expect(FileUtils).to receive(:mkdir_p).with(File.dirname(temporary_file_path)) {}
|
37
37
|
expect(File).to receive(:open).with(temporary_file_path, 'w') { |filename, mode, &block| block.call writer }
|
38
|
-
formatter.
|
38
|
+
formatter.write_summary(123, 1, 2, 3)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -50,13 +50,13 @@ describe Guard::RSpec::Formatter do
|
|
50
50
|
|
51
51
|
it 'writes summary line and failed location in tmp dir' do
|
52
52
|
allow(formatter).to receive(:examples) { [failed_example] }
|
53
|
-
formatter.
|
53
|
+
formatter.write_summary(123, 3, 1, 0)
|
54
54
|
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'writes only uniq filenames out' do
|
58
58
|
allow(formatter).to receive(:examples) { [failed_example, failed_example] }
|
59
|
-
formatter.
|
59
|
+
formatter.write_summary(123, 3, 1, 0)
|
60
60
|
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
|
61
61
|
end
|
62
62
|
|
@@ -107,14 +107,14 @@ describe Guard::RSpec::Formatter do
|
|
107
107
|
|
108
108
|
context 'with only success' do
|
109
109
|
it 'notifies success' do
|
110
|
-
formatter.
|
110
|
+
formatter.write_summary(123, 3, 0, 0)
|
111
111
|
expect(result).to match /^3 examples, 0 failures in 123\.0 seconds\n$/
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
115
|
context 'with pending' do
|
116
116
|
it "notifies pending too" do
|
117
|
-
formatter.
|
117
|
+
formatter.write_summary(123, 3, 0, 1)
|
118
118
|
expect(result).to match /^3 examples, 0 failures \(1 pending\) in 123\.0 seconds\n$/
|
119
119
|
end
|
120
120
|
end
|
@@ -56,6 +56,7 @@ describe Guard::RSpec::Runner do
|
|
56
56
|
spec_paths: %w[spec1 spec2],
|
57
57
|
run_all: { message: 'Custom message' }
|
58
58
|
} }
|
59
|
+
before { allow(inspector).to receive(:failed) }
|
59
60
|
|
60
61
|
it 'builds commands with spec paths' do
|
61
62
|
expect(Guard::RSpec::Command).to receive(:new).with(%w[spec1 spec2], kind_of(Hash))
|
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.9
|
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-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -106,6 +106,8 @@ files:
|
|
106
106
|
- LICENSE.txt
|
107
107
|
- README.md
|
108
108
|
- Rakefile
|
109
|
+
- gemfiles/Gemfile.rspec-2.14
|
110
|
+
- gemfiles/Gemfile.rspec-3.0
|
109
111
|
- guard-rspec.gemspec
|
110
112
|
- lib/guard/rspec.rb
|
111
113
|
- lib/guard/rspec/command.rb
|