File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ unless ENV["PACKAGING"] && ENV["PACKAGING"] == "yes"
6464 gem "byebug" , "~> 8.2.2"
6565 gem "derailed_benchmarks" , "~> 1.3.0"
6666 gem "stackprof" , "~> 0.2.8"
67+ gem "guard-rspec"
68+ gem "guard-bundler"
6769 end
6870
6971 group :test do
Original file line number Diff line number Diff line change 1+ #!/usr/bin/ruby
2+ #
3+ # More info at https://github.com/guard/guard#readme
4+
5+ guard_opts = {
6+ cmd : "bundle exec rspec --fail-fast" ,
7+ all_on_start : true ,
8+ all_after_pass : true ,
9+ failed_mode : :focus
10+ }
11+
12+ DEBUG = false
13+
14+ def reload ( target )
15+ puts "-> #{ target } " if DEBUG
16+ target
17+ end
18+
19+ def all_specs ; reload "all_specs" ; "spec" end
20+ def library_specs ; reload "library_specs" ; "spec/libraries" end
21+ def provider_specs ; reload "provider_specs" ; "spec/providers" end
22+
23+ group :rspec do
24+ guard :rspec , guard_opts do
25+ watch ( 'app/controllers/application_controller.rb' ) {
26+ "spec/controllers"
27+ }
28+ watch ( %r{^app/(.+)\. rb$} ) { |m | "spec/#{ m [ 1 ] } _spec.rb" }
29+ watch ( %r{^app/(.*)(\. erb|\. haml)$} ) { |m | "spec/#{ m [ 1 ] } #{ m [ 2 ] } _spec.rb" }
30+ watch ( %r{^lib/(.+)\. rb$} ) { |m | "spec/lib/#{ m [ 1 ] } _spec.rb" }
31+ watch ( %r{^app/controllers/(.+)_(controller)\. rb$} ) { |m |
32+ [
33+ "spec/routing/#{ m [ 1 ] } _routing_spec.rb" ,
34+ "spec/#{ m [ 2 ] } s/#{ m [ 1 ] } _#{ m [ 2 ] } _spec.rb" ,
35+ "spec/acceptance/#{ m [ 1 ] } _spec.rb"
36+ ]
37+ }
38+ watch ( %r{^Gemfile$} ) { all_specs }
39+ watch ( %r{^Gemfile.lock$} ) { all_specs }
40+ watch ( %r{^spec/spec_helper\. rb$} ) { all_specs }
41+ watch ( %r{^spec/helpers/.+\. rb$} ) { all_specs }
42+ watch ( %r{^spec/.+_spec\. rb$} )
43+ end
44+ end
45+
46+ group :bundler do
47+ guard :bundler do
48+ watch ( "Gemfile" )
49+ end
50+ end
You can’t perform that action at this time.
0 commit comments