Skip to content

Instantly share code, notes, and snippets.

@chaimleib
Last active December 1, 2015 18:01
Show Gist options
  • Save chaimleib/bb4c7bbb30909d84d112 to your computer and use it in GitHub Desktop.
Save chaimleib/bb4c7bbb30909d84d112 to your computer and use it in GitHub Desktop.
Various rspec commands
function capybara_rspec() {
USING_CAPYBARA=true bundle exec rspec \
--color \
-r turnip/rspec \
-r turnip/capybara \
--order defined \
"$@"
#--format documentation \
}
function tests_ending_with() {
find ./spec/features/ -type f -name "*$1"
}
function changed_tests() {
git status -s | sed -E 's/^ *[^ ]+ *//' | grep '^spec/'
}
function rspec_changed() {
capybara_rspec $(changed_tests)
}
# capybara_rspec $(tests_ending_with "_spec.rb")
# capybara_rspec $(tests_ending_with ".feature")
# rspec_changed
# capybara_rspec spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment