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 466dce0
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit 466dce0

Please sign in to comment.