-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a generic Guardfile. `spec_helper.rb` includes a stub on `Setting` in a before(:each), which prevents various spec files from running without the rest of the suite. This pattern also has the issue that it stubs `Setting#cache_backend` without warning to developers, giving unexpected results. We should find a way to remove it. See #38. In the meanwhile, we introduce a guard to prevent errors, and allow modules that don't depend on `Setting` to be tested independently.
- Loading branch information
Tom Johnson
committed
Feb 1, 2017
1 parent
00b0a57
commit bd5b40f
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 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" | ||
|
||
# Using -W0 to suppress warnings in automatic test runs | ||
guard :rspec, cmd: 'RUBYOPT="-W0" 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) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters