Skip to content
Snippets Groups Projects
Commit fe43c48b authored by Josh Frye's avatar Josh Frye
Browse files

Add Guard to run rspec on file change.

parent da8e0f86
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -236,6 +236,8 @@ group :development do
gem 'rblineprof', platform: :mri, require: false
gem 'web-console', '~> 2.0'
 
gem 'guard-rspec', require: false
# Better errors handler
gem 'better_errors', '~> 1.0.1'
gem 'binding_of_caller', '~> 0.7.2'
Loading
Loading
Loading
Loading
@@ -396,6 +396,20 @@ GEM
grape-entity (0.4.8)
activesupport
multi_json (>= 1.3.2)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.6.4)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
haml (4.0.7)
tilt
haml-rails (0.9.0)
Loading
Loading
@@ -459,6 +473,7 @@ GEM
rb-inotify (>= 0.9)
loofah (2.0.3)
nokogiri (>= 1.5.9)
lumberjack (1.0.10)
macaddr (1.7.1)
systemu (~> 2.6.2)
mail (2.6.3)
Loading
Loading
@@ -474,6 +489,7 @@ GEM
multi_xml (0.5.5)
multipart-post (2.0.0)
mysql2 (0.3.20)
nenv (0.2.0)
nested_form (0.3.2)
net-ldap (0.12.1)
net-ssh (3.0.1)
Loading
Loading
@@ -484,6 +500,9 @@ GEM
newrelic_rpm (3.9.4.245)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
notiffany (0.0.8)
nenv (~> 0.1)
shellany (~> 0.0)
nprogress-rails (0.1.6.7)
oauth (0.4.7)
oauth2 (1.0.0)
Loading
Loading
@@ -731,6 +750,7 @@ GEM
sexp_processor (4.6.0)
sham_rack (1.3.6)
rack
shellany (0.0.1)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
sidekiq (4.0.1)
Loading
Loading
@@ -941,6 +961,7 @@ DEPENDENCIES
gon (~> 6.0.1)
grape (~> 0.13.0)
grape-entity (~> 0.4.2)
guard-rspec
haml-rails (~> 0.9.0)
hipchat (~> 1.5.0)
html-pipeline (~> 1.11.0)
Loading
Loading
guard :rspec, cmd: "bundle exec rspec" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
# Feel free to open issues for suggestions and improvements
# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
# Rails files
rails = dsl.rails(view_extensions: %w(erb haml slim))
dsl.watch_spec_files_for(rails.app_files)
dsl.watch_spec_files_for(rails.views)
watch(rails.controllers) do |m|
[
rspec.spec.("routing/#{m[1]}_routing"),
rspec.spec.("controllers/#{m[1]}_controller"),
rspec.spec.("acceptance/#{m[1]}")
]
end
# Rails config changes
watch(rails.spec_helper) { rspec.spec_dir }
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
ignore! /tmp/
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment