Skip to content

Commit

Permalink
Fix rspec focus label left in tests
Browse files Browse the repository at this point in the history
This change removes a focus label left in a test in the last PR #42, as per issue #43.

It also updates `.travis.yml` to add a new check for focus labels to attempt to prevent it happening again. If the check finds a match it will break the build.
  • Loading branch information
Cruikshanks committed Nov 28, 2016
1 parent a78815d commit 83bec29
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ git:
# https://docs.travis-ci.com/user/languages/ruby#Caching-Bundler
cache: bundler

# Using the ability to customise the Travis build to check for 'focus' labels
# i.e. labels used when working on a spec but which we don't want appearing in
# the final commit to master
before_script:
- echo "Checking for use of 'focus' labels in specs"
# Reworking of http://stackoverflow.com/a/30495279/6117745
# If grep returns 0 (match found), test 0 -eq 1 will return 1.
# If grep returns 1 (no match found), test 1 -eq 1 will return 0.
# If grep returns 2 (error), test 2 -eq 1 will return 1.
- grep -r --include="*_spec.rb" "focus: true" spec/; test $? -eq 1

# This section was added as per https://docs.travis-ci.com/user/code-climate/
# To protect our codeclimate stats rather than adding the Codeclimate API key for ea-area_lookup
# in the open we used this guide https://docs.travis-ci.com/user/encryption-keys/ to encryt the
Expand Down
2 changes: 1 addition & 1 deletion spec/quke/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
end
end

describe '#stop_on_error', focus: true do
describe '#stop_on_error' do
context 'when NOT specified in the config file' do
it 'defaults to false' do
Quke::Configuration.file_location = data_path('.no_file.yml')
Expand Down

0 comments on commit 83bec29

Please sign in to comment.