feat(bin): add script to run rspec when files have changed

This commit is contained in:
Ade Attwood 2024-02-12 16:17:42 +00:00
parent 7b1243035b
commit e11deb18fd

View file

@ -0,0 +1,17 @@
#!/bin/bash
#
# Run rspec tests when files are modified in the spec or app directory.
#
# Example usage:
#
# # Run the two tests whenever a file is changed.
# rspec-watch spec/models/user_spec.rb spec/controllers/users_controller_spec.rb
while inotifywait -r -e modify spec app; do
clear
echo "Running tests..."
echo ""
RSPEC_COVERAGE=0 bundle exec rspec -fd $@
done