guard-rspec 4.6.1 → 4.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -24
- data/lib/guard/rspec/runner.rb +9 -3
- data/lib/guard/rspec/version.rb +1 -1
- data/spec/lib/guard/rspec/runner_spec.rb +44 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04c187f95cb55d3b3c177679cf1f57f09fbe654e
|
4
|
+
data.tar.gz: 50adaf9c367ab6346a7433265916e6db9439ae60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a496bc4e6a816e4b9b12807f42e2ff27a062ad8564bb06caa937282941f8071bccd68c7d9ec77e445960821456a3cd19dc2d15ba6b7e059fef6af9c7573024fe
|
7
|
+
data.tar.gz: f1ab9ca51ee6b43dc752b7d6c41cb6906ff2cab54a42d45fc89fddb2ff4aa5b4f059c374963a9d4e5eba9148d51e661e0ed278555a9a21c24cdca607aa376a18
|
data/README.md
CHANGED
@@ -109,32 +109,11 @@ guard :rspec, cmd: 'rspec -f html -o ./tmp/spec_results.html', launchy: './tmp/s
|
|
109
109
|
end
|
110
110
|
```
|
111
111
|
|
112
|
-
### Integration
|
112
|
+
### Zeus Integration
|
113
113
|
|
114
|
-
|
115
|
-
|
116
|
-
Second, since Guard::RSpec 4.6.x, the output file name is passed using environment variables - but Zeus doesn't pass these when rerunning tests, so you get this error: #334
|
117
|
-
|
118
|
-
The workaround is to create a custom Zeus plan:
|
119
|
-
|
120
|
-
1. `zeus init`
|
121
|
-
2. edit `custom_plan.rb` to contain the following:
|
122
|
-
|
123
|
-
```ruby
|
124
|
-
require 'zeus/rails'
|
125
|
-
|
126
|
-
class CustomPlan < Zeus::Rails
|
127
|
-
def test(*args)
|
128
|
-
ENV['GUARD_RSPEC_RESULTS_FILE'] = 'tmp/guard_rspec_results.txt' # Guard::RSpec::Runner::TEMPORARY_FILE_PATH
|
129
|
-
super
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
Zeus.plan = CustomPlan.new
|
134
|
-
```
|
135
|
-
|
136
|
-
And that's it. (I'd like things to work without this, but I don't know how.)
|
114
|
+
You can use plain `Zeus` or you can use `Guard::Zeus` for managing the `Zeus` server (but you'll want to remove the spec watchers from `Guard::Zeus`, or you'll have tests running multiple times).
|
137
115
|
|
116
|
+
Also, if you get warnings about empty environment, be sure to [read about this workaround](https://github.com/guard/guard-rspec/wiki/Warning:-no-environment)
|
138
117
|
|
139
118
|
### Using parallel_tests
|
140
119
|
|
data/lib/guard/rspec/runner.rb
CHANGED
@@ -39,7 +39,9 @@ module Guard
|
|
39
39
|
return true if paths.empty?
|
40
40
|
Compat::UI.info("Running: #{paths.join(' ')}", reset: true)
|
41
41
|
_run(paths, options) do |all_green|
|
42
|
-
|
42
|
+
next false unless all_green
|
43
|
+
next true unless options[:all_after_pass]
|
44
|
+
run_all
|
43
45
|
end
|
44
46
|
end
|
45
47
|
|
@@ -53,7 +55,6 @@ module Guard
|
|
53
55
|
fail NoCmdOptionError unless options[:cmd]
|
54
56
|
command = Command.new(paths, options)
|
55
57
|
_really_run(command, options, &block)
|
56
|
-
true
|
57
58
|
rescue RSpecProcess::Failure, NoCmdOptionError => ex
|
58
59
|
Compat::UI.error(ex.to_s)
|
59
60
|
notifier.notify_failure
|
@@ -71,7 +72,12 @@ module Guard
|
|
71
72
|
notifier.notify(results.summary)
|
72
73
|
_open_launchy
|
73
74
|
|
74
|
-
|
75
|
+
all_green = process.all_green?
|
76
|
+
if block_given?
|
77
|
+
yield all_green
|
78
|
+
else
|
79
|
+
all_green
|
80
|
+
end
|
75
81
|
end
|
76
82
|
|
77
83
|
def _open_launchy
|
data/lib/guard/rspec/version.rb
CHANGED
@@ -137,6 +137,20 @@ RSpec.describe Guard::RSpec::Runner do
|
|
137
137
|
expect(notifier).to have_received(:notify_failure)
|
138
138
|
end
|
139
139
|
end
|
140
|
+
|
141
|
+
describe "return value" do
|
142
|
+
subject { runner.run_all }
|
143
|
+
|
144
|
+
it { is_expected.to be true }
|
145
|
+
|
146
|
+
context "when process is not all green" do
|
147
|
+
before do
|
148
|
+
allow(process).to receive(:all_green?).and_return(false)
|
149
|
+
end
|
150
|
+
|
151
|
+
it { is_expected.to be false }
|
152
|
+
end
|
153
|
+
end
|
140
154
|
end
|
141
155
|
|
142
156
|
describe "#run" do
|
@@ -284,5 +298,35 @@ RSpec.describe Guard::RSpec::Runner do
|
|
284
298
|
expect(notifier).to receive(:notify_failure)
|
285
299
|
runner.run(paths)
|
286
300
|
end
|
301
|
+
|
302
|
+
describe "return value" do
|
303
|
+
subject { runner.run(paths) }
|
304
|
+
|
305
|
+
it { is_expected.to be true }
|
306
|
+
|
307
|
+
context "with all_after_pass option" do
|
308
|
+
let(:options) do
|
309
|
+
{ cmd: "rspec", all_after_pass: true, run_all: {}, spec_paths: paths }
|
310
|
+
end
|
311
|
+
|
312
|
+
it { is_expected.to be true }
|
313
|
+
|
314
|
+
describe "when all tests fail" do
|
315
|
+
before do
|
316
|
+
allow(process).to receive(:all_green?).and_return(true, false)
|
317
|
+
end
|
318
|
+
|
319
|
+
it { is_expected.to be false }
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
context "when process is not all green" do
|
324
|
+
before do
|
325
|
+
allow(process).to receive(:all_green?).and_return(false)
|
326
|
+
end
|
327
|
+
|
328
|
+
it { is_expected.to be false }
|
329
|
+
end
|
330
|
+
end
|
287
331
|
end
|
288
332
|
end
|
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.6.
|
4
|
+
version: 4.6.2
|
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: 2015-07-
|
11
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|