guard-rspec 4.3.1 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +262 -0
- data/.rspec +2 -0
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +10 -0
- data/.travis.yml +2 -3
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +9 -2
- data/Guardfile +11 -4
- data/README.md +8 -4
- data/Rakefile +23 -2
- data/gemfiles/Gemfile.rspec-2.14 +1 -0
- data/gemfiles/Gemfile.rspec-2.99 +14 -0
- data/gemfiles/Gemfile.rspec-3.0 +1 -0
- data/guard-rspec.gemspec +18 -16
- data/lib/guard/rspec.rb +13 -8
- data/lib/guard/rspec/command.rb +30 -12
- data/lib/guard/rspec/deprecator.rb +32 -11
- data/lib/guard/rspec/inspectors/base_inspector.rb +36 -15
- data/lib/guard/rspec/inspectors/factory.rb +7 -8
- data/lib/guard/rspec/inspectors/focused_inspector.rb +2 -2
- data/lib/guard/rspec/inspectors/keeping_inspector.rb +7 -6
- data/lib/guard/rspec/inspectors/simple_inspector.rb +3 -3
- data/lib/guard/rspec/notifier.rb +9 -5
- data/lib/guard/rspec/options.rb +12 -10
- data/lib/guard/rspec/runner.rb +41 -25
- data/lib/guard/rspec/templates/Guardfile +43 -15
- data/lib/guard/rspec/version.rb +1 -1
- data/lib/guard/rspec_formatter.rb +111 -0
- data/spec/lib/guard/rspec/command_spec.rb +48 -12
- data/spec/lib/guard/rspec/deprecator_spec.rb +37 -18
- data/spec/lib/guard/rspec/inspectors/base_inspector_spec.rb +129 -18
- data/spec/lib/guard/rspec/inspectors/factory_spec.rb +20 -15
- data/spec/lib/guard/rspec/inspectors/focused_inspector_spec.rb +79 -13
- data/spec/lib/guard/rspec/inspectors/keeping_inspector_spec.rb +103 -33
- data/spec/lib/guard/rspec/inspectors/shared_examples.rb +93 -31
- data/spec/lib/guard/rspec/inspectors/simple_inspector_spec.rb +52 -16
- data/spec/lib/guard/rspec/notifier_spec.rb +49 -27
- data/spec/lib/guard/rspec/runner_spec.rb +120 -77
- data/spec/lib/guard/rspec_formatter_spec.rb +144 -0
- data/spec/lib/guard/rspec_spec.rb +23 -18
- data/spec/spec_helper.rb +99 -14
- metadata +12 -7
- data/lib/guard/rspec/formatter.rb +0 -99
- data/spec/lib/guard/rspec/formatter_spec.rb +0 -122
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63d0eea3ffad79ccecdc49bb030f2913a584de76
|
4
|
+
data.tar.gz: 5364e3dae2d4fe5ba4dfe677370225680791c250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b99f367fa4295cb66204a8797c98c1b9e96b0b2909dade71aba88519aca2da620fe7e096c7e4466a615f523224ed2864effd67a4aab974f6b226a75117e590be
|
7
|
+
data.tar.gz: 90a308a911a923edbb5463292846316927342b9a32caf9d60572916b1e5df9370f944e818f7b841e932f8f532573bdf027805c98d8cde9da638cb120a8155f95
|
data/.hound.yml
ADDED
@@ -0,0 +1,262 @@
|
|
1
|
+
inherit_from:
|
2
|
+
.rubocop_todo.yml
|
3
|
+
|
4
|
+
#AllCops:
|
5
|
+
# Exclude:
|
6
|
+
# - db/schema.rb
|
7
|
+
|
8
|
+
AccessorMethodName:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
ActionFilter:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
Alias:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
ArrayJoin:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
AsciiComments:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
AsciiIdentifiers:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
Attr:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
BlockNesting:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
CaseEquality:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
CharacterLiteral:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
ClassAndModuleChildren:
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
ClassLength:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
ClassVars:
|
45
|
+
Enabled: false
|
46
|
+
|
47
|
+
CollectionMethods:
|
48
|
+
PreferredMethods:
|
49
|
+
find: detect
|
50
|
+
reduce: inject
|
51
|
+
collect: map
|
52
|
+
find_all: select
|
53
|
+
|
54
|
+
ColonMethodCall:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
CommentAnnotation:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
CyclomaticComplexity:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
Delegate:
|
64
|
+
Enabled: false
|
65
|
+
|
66
|
+
DeprecatedHashMethods:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Documentation:
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
DotPosition:
|
73
|
+
EnforcedStyle: trailing
|
74
|
+
|
75
|
+
DoubleNegation:
|
76
|
+
Enabled: false
|
77
|
+
|
78
|
+
EachWithObject:
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
EmptyLiteral:
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
Encoding:
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
EvenOdd:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
FileName:
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
FlipFlop:
|
94
|
+
Enabled: false
|
95
|
+
|
96
|
+
FormatString:
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
GlobalVars:
|
100
|
+
Enabled: false
|
101
|
+
|
102
|
+
GuardClause:
|
103
|
+
Enabled: false
|
104
|
+
|
105
|
+
IfUnlessModifier:
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
IfWithSemicolon:
|
109
|
+
Enabled: false
|
110
|
+
|
111
|
+
InlineComment:
|
112
|
+
Enabled: false
|
113
|
+
|
114
|
+
Lambda:
|
115
|
+
Enabled: false
|
116
|
+
|
117
|
+
LambdaCall:
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
LineEndConcatenation:
|
121
|
+
Enabled: false
|
122
|
+
|
123
|
+
LineLength:
|
124
|
+
Max: 80
|
125
|
+
|
126
|
+
MethodLength:
|
127
|
+
Enabled: false
|
128
|
+
|
129
|
+
ModuleFunction:
|
130
|
+
Enabled: false
|
131
|
+
|
132
|
+
NegatedIf:
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
NegatedWhile:
|
136
|
+
Enabled: false
|
137
|
+
|
138
|
+
Next:
|
139
|
+
Enabled: false
|
140
|
+
|
141
|
+
NilComparison:
|
142
|
+
Enabled: false
|
143
|
+
|
144
|
+
Not:
|
145
|
+
Enabled: false
|
146
|
+
|
147
|
+
NumericLiterals:
|
148
|
+
Enabled: false
|
149
|
+
|
150
|
+
OneLineConditional:
|
151
|
+
Enabled: false
|
152
|
+
|
153
|
+
OpMethod:
|
154
|
+
Enabled: false
|
155
|
+
|
156
|
+
ParameterLists:
|
157
|
+
Enabled: false
|
158
|
+
|
159
|
+
PercentLiteralDelimiters:
|
160
|
+
Enabled: false
|
161
|
+
|
162
|
+
PerlBackrefs:
|
163
|
+
Enabled: false
|
164
|
+
|
165
|
+
PredicateName:
|
166
|
+
NamePrefixBlacklist:
|
167
|
+
- is_
|
168
|
+
|
169
|
+
Proc:
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
RaiseArgs:
|
173
|
+
Enabled: false
|
174
|
+
|
175
|
+
RegexpLiteral:
|
176
|
+
Enabled: false
|
177
|
+
|
178
|
+
SelfAssignment:
|
179
|
+
Enabled: false
|
180
|
+
|
181
|
+
SingleLineBlockParams:
|
182
|
+
Enabled: false
|
183
|
+
|
184
|
+
SingleLineMethods:
|
185
|
+
Enabled: false
|
186
|
+
|
187
|
+
SignalException:
|
188
|
+
Enabled: false
|
189
|
+
|
190
|
+
SpecialGlobalVars:
|
191
|
+
Enabled: false
|
192
|
+
|
193
|
+
StringLiterals:
|
194
|
+
EnforcedStyle: double_quotes
|
195
|
+
|
196
|
+
VariableInterpolation:
|
197
|
+
Enabled: false
|
198
|
+
|
199
|
+
TrailingComma:
|
200
|
+
Enabled: false
|
201
|
+
|
202
|
+
TrivialAccessors:
|
203
|
+
Enabled: false
|
204
|
+
|
205
|
+
VariableInterpolation:
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
WhenThen:
|
209
|
+
Enabled: false
|
210
|
+
|
211
|
+
WhileUntilModifier:
|
212
|
+
Enabled: false
|
213
|
+
|
214
|
+
WordArray:
|
215
|
+
Enabled: false
|
216
|
+
|
217
|
+
# Lint
|
218
|
+
|
219
|
+
AmbiguousOperator:
|
220
|
+
Enabled: false
|
221
|
+
|
222
|
+
AmbiguousRegexpLiteral:
|
223
|
+
Enabled: false
|
224
|
+
|
225
|
+
AssignmentInCondition:
|
226
|
+
Enabled: false
|
227
|
+
|
228
|
+
ConditionPosition:
|
229
|
+
Enabled: false
|
230
|
+
|
231
|
+
DeprecatedClassMethods:
|
232
|
+
Enabled: false
|
233
|
+
|
234
|
+
ElseLayout:
|
235
|
+
Enabled: false
|
236
|
+
|
237
|
+
HandleExceptions:
|
238
|
+
Enabled: false
|
239
|
+
|
240
|
+
InvalidCharacterLiteral:
|
241
|
+
Enabled: false
|
242
|
+
|
243
|
+
LiteralInCondition:
|
244
|
+
Enabled: false
|
245
|
+
|
246
|
+
LiteralInInterpolation:
|
247
|
+
Enabled: false
|
248
|
+
|
249
|
+
Loop:
|
250
|
+
Enabled: false
|
251
|
+
|
252
|
+
ParenthesesAsGroupedExpression:
|
253
|
+
Enabled: false
|
254
|
+
|
255
|
+
RequireParentheses:
|
256
|
+
Enabled: false
|
257
|
+
|
258
|
+
UnderscorePrefixedVariableName:
|
259
|
+
Enabled: false
|
260
|
+
|
261
|
+
Void:
|
262
|
+
Enabled: false
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2014-11-06 03:19:15 +0100 using RuboCop version 0.27.0.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 1
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Max: 20
|
data/.travis.yml
CHANGED
data/CONTRIBUTING.md
CHANGED
@@ -30,7 +30,7 @@ Development
|
|
30
30
|
Pull requests are very welcome! Please try to follow these simple rules if applicable:
|
31
31
|
|
32
32
|
* Please create a topic branch for every separate change you make.
|
33
|
-
* Make sure your patches are well tested. All specs run with `rake
|
33
|
+
* Make sure your patches are well tested. All specs run with `rake test:all_versions` must pass.
|
34
34
|
* Update the [README](https://github.com/guard/guard-rspec/blob/master/README.md).
|
35
35
|
* Please **do not change** the version number.
|
36
36
|
|
data/Gemfile
CHANGED
@@ -3,9 +3,16 @@ source "https://rubygems.org"
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :test do
|
6
|
-
gem
|
6
|
+
gem "coveralls", require: false
|
7
|
+
end
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem "rspec", "~> 3.1"
|
11
|
+
gem "rubocop", "0.25.0", require: false
|
12
|
+
gem "guard-rubocop", require: false
|
13
|
+
gem "guard-compat", ">= 0.0.2", require: false
|
7
14
|
end
|
8
15
|
|
9
16
|
group :tool do
|
10
|
-
gem
|
17
|
+
gem "ruby_gntp", require: false
|
11
18
|
end
|
data/Guardfile
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
group :specs, halt_on_fail: true do
|
2
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
3
|
+
watch(%r{^spec/.+_spec\.rb})
|
4
|
+
watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
5
|
+
watch("spec/spec_helper.rb") { "spec" }
|
6
|
+
end
|
7
|
+
|
8
|
+
guard :rubocop do
|
9
|
+
watch(%r{.+\.rb$})
|
10
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
11
|
+
end
|
5
12
|
end
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
Guard::RSpec allows to automatically & intelligently launch specs when files are modified.
|
6
6
|
|
7
7
|
* Compatible with RSpec >2.14 & 3
|
8
|
-
* Tested against Ruby 1.9.3, 2.0.0, JRuby and Rubinius.
|
8
|
+
* Tested against Ruby 1.9.3, 2.0.0, 2.1.2, JRuby and Rubinius.
|
9
9
|
|
10
10
|
## Install
|
11
11
|
|
@@ -32,7 +32,7 @@ Guard::RSpec can be adapted to all kinds of projects, some examples:
|
|
32
32
|
### Standard RubyGem project
|
33
33
|
|
34
34
|
``` ruby
|
35
|
-
guard :rspec do
|
35
|
+
guard :rspec, cmd: 'rspec' do
|
36
36
|
watch(%r{^spec/.+_spec\.rb$})
|
37
37
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
38
38
|
watch('spec/spec_helper.rb') { "spec" }
|
@@ -42,7 +42,7 @@ end
|
|
42
42
|
### Typical Rails app
|
43
43
|
|
44
44
|
``` ruby
|
45
|
-
guard :rspec do
|
45
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
46
46
|
watch('spec/spec_helper.rb') { "spec" }
|
47
47
|
watch('config/routes.rb') { "spec/routing" }
|
48
48
|
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
@@ -58,7 +58,7 @@ Please read [Guard doc](https://github.com/guard/guard#readme) for more informat
|
|
58
58
|
|
59
59
|
## Options
|
60
60
|
|
61
|
-
Guard::RSpec 4.0 now uses a simpler approach with the new `cmd` option that let you precisely define which rspec command will be launched on each run. This option is required due to the number of different ways possible to invoke rspec, the template now includes a default that should work for most applications but may not be optimal for all. As example if you want to support Spring with a custom formatter (progress by default) use:
|
61
|
+
Guard::RSpec 4.0 now uses a simpler approach with the new `cmd` option that let you precisely define which rspec command will be launched on each run. **This option is required** due to the number of different ways possible to invoke rspec, the template now includes a default that should work for most applications but may not be optimal for all. As example if you want to support Spring with a custom formatter (progress by default) use:
|
62
62
|
|
63
63
|
``` ruby
|
64
64
|
guard :rspec, cmd: 'spring rspec -f doc' do
|
@@ -80,6 +80,8 @@ end
|
|
80
80
|
|
81
81
|
``` ruby
|
82
82
|
cmd: 'zeus rspec' # Specify a custom rspec command to run, default: 'rspec'
|
83
|
+
cmd_additional_args: '-f progress' # Any arguments that should be added after the default
|
84
|
+
# arguments are applied but before the spec list
|
83
85
|
spec_paths: ['spec'] # Specify a custom array of paths that contain spec files
|
84
86
|
failed_mode: :focus # What to do with failed specs
|
85
87
|
# Available values:
|
@@ -91,6 +93,8 @@ all_on_start: true # Run all the specs at startup, default: false
|
|
91
93
|
launchy: nil # Pass a path to an rspec results file, e.g. ./tmp/spec_results.html
|
92
94
|
notification: false # Display notification after the specs are done running, default: true
|
93
95
|
run_all: { cmd: 'custom rspec command', message: 'custom message' } # Custom options to use when running all specs
|
96
|
+
title: 'My project' # Display a custom title for the notification, default: 'RSpec results'
|
97
|
+
chdir: 'directory' # run rspec from within a given subdirectory (useful if project has separate specs for submodules)
|
94
98
|
```
|
95
99
|
|
96
100
|
### Using Launchy to view rspec results
|
data/Rakefile
CHANGED
@@ -1,5 +1,26 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
require
|
3
|
+
require "rspec/core/rake_task"
|
4
4
|
RSpec::Core::RakeTask.new(:spec)
|
5
5
|
task default: :spec
|
6
|
+
|
7
|
+
namespace :test do
|
8
|
+
desc "Locally run tests like Travis and HoundCI would"
|
9
|
+
task :all_versions do
|
10
|
+
system(*%w(bundle update --quiet)) || abort
|
11
|
+
system(*%w(bundle exec rubocop -c .hound.yml)) || abort
|
12
|
+
|
13
|
+
gemfiles = Dir["gemfiles/Gemfile.rspec-*"]
|
14
|
+
|
15
|
+
actual_gemfiles = gemfiles.select { |f| /\d\.\d{1,2}$/ =~ f }
|
16
|
+
actual_gemfiles.each do |gemfile|
|
17
|
+
STDOUT.puts
|
18
|
+
STDOUT.puts "----------------------------------------------------- "
|
19
|
+
STDOUT.puts " >> Running tests using Gemfile: #{gemfile} <<"
|
20
|
+
STDOUT.puts "----------------------------------------------------- "
|
21
|
+
ENV["BUNDLE_GEMFILE"] = gemfile
|
22
|
+
system(*%w(bundle update --quiet)) || abort
|
23
|
+
system(*%w(bundle exec rspec)) || abort
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|