Add guard support for tests.

This commit is contained in:
Glenn Y. Rolland 2015-08-11 23:59:23 +02:00
parent a56389f9eb
commit 6adaec530c
2 changed files with 31 additions and 0 deletions

25
Guardfile Normal file
View file

@ -0,0 +1,25 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
#
guard :minitest, :spring => false do
watch(%r{^lib/(.+)\.rb$}) do |m|
name = m[1].split('/')[1..-1].join('_')
"spec/#{name}_spec.rb"
end
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^spec/spec_helper\.rb$}) { "test" }
end

View file

@ -30,8 +30,14 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake", "~> 10.4.2"
spec.add_development_dependency "minitest", "~> 5.7.0"
spec.add_development_dependency "minitest-reporters"
spec.add_development_dependency "pry", "~> 0.10.1"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "guard"
spec.add_development_dependency "guard-minitest"
spec.add_development_dependency "rb-fsevent"
spec.add_development_dependency "terminal-notifier-guard"
spec.add_runtime_dependency "qtbindings", "~> 4.8.6"
spec.add_runtime_dependency "thor", "~> 0.19.1"