Skip to content

Instantly share code, notes, and snippets.

@abhchand
Last active September 21, 2017 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhchand/658c39d5205c8b56a7928fc9bd00e9e7 to your computer and use it in GitHub Desktop.
Save abhchand/658c39d5205c8b56a7928fc9bd00e9e7 to your computer and use it in GitHub Desktop.
Blog Post: The interactor design pattern
function run_changed_specs {
arg=$1
branch=${arg:-master}
files=$(git diff $branch..HEAD --name-only | grep spec | grep -v spec_helper.rb)
echo "==="
echo "Running files changed since $branch:"
echo $files
echo ""
rspec $(echo $files | tr '\n' ' ')
}
> run_changed_specs
===
Running files changed since master:
spec/features/admin/creating_a_user.rb spec/models/user_spec.rb spec/services/users/create_user_service.rb
Randomized with seed 46260
..................
Finished in 9.46 seconds (files took 1.39 seconds to load)
18 examples, 0 failures
Randomized with seed 46260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment