|
1 | 1 | ignore %r{^\.gem/}
|
2 | 2 |
|
3 |
| -group :red_green_refactor, halt_on_fail: true do |
4 |
| - guard "minitest" do |
| 3 | +def rubocop_opts |
| 4 | + { :all_on_start => false, :keep_failed => false, :cli => "-r finstyle" } |
| 5 | +end |
| 6 | + |
| 7 | +def cucumber_opts |
| 8 | + cucumber_cli = "--no-profile --color --format progress --strict" |
| 9 | + cucumber_cli += " --tags ~@spawn" if RUBY_PLATFORM =~ /mswin|mingw|windows/ |
| 10 | + |
| 11 | + { :all_on_start => false, :cli => cucumber_cli } |
| 12 | +end |
| 13 | + |
| 14 | +def yard_opts |
| 15 | + { :port => "8808" } |
| 16 | +end |
| 17 | + |
| 18 | +group :red_green_refactor, :halt_on_fail => true do |
| 19 | + guard :minitest do |
5 | 20 | watch(%r{^spec/(.*)_spec\.rb})
|
6 | 21 | watch(%r{^lib/(.*)([^/]+)\.rb}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
7 | 22 | watch(%r{^spec/spec_helper\.rb}) { "spec" }
|
8 | 23 | end
|
9 | 24 |
|
10 |
| - guard :rubocop, all_on_start: false, keep_failed: false, cli: "-r finstyle" do |
| 25 | + guard :rubocop, rubocop_opts do |
11 | 26 | watch(%r{.+\.rb$})
|
12 | 27 | watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
13 | 28 | end
|
14 | 29 | end
|
15 | 30 |
|
16 |
| -cucumber_cli = "--no-profile --color --format progress --strict" |
17 |
| -cucumber_cli += " --tags ~@spawn" if RUBY_PLATFORM =~ /mswin|mingw|windows/ |
18 |
| -guard "cucumber", all_on_start: false, cli: cucumber_cli do |
| 31 | +guard :cucumber, cucumber_opts do |
19 | 32 | watch(%r{^features/.+\.feature$})
|
20 |
| - watch(%r{^features/support/.+$}) { "features" } |
| 33 | + watch(%r{^features/support/.+$}) { "features" } |
21 | 34 | watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
|
22 | 35 | Dir[File.join("**/#{m[1]}.feature")][0] || "features"
|
23 | 36 | end
|
24 | 37 | end
|
25 | 38 |
|
26 |
| -guard "yard", port: "8808" do |
| 39 | +guard :yard, yard_opts do |
27 | 40 | watch(%r{lib/.+\.rb})
|
28 | 41 | end
|
0 commit comments