Last active
December 1, 2015 18:01
-
-
Save chaimleib/bb4c7bbb30909d84d112 to your computer and use it in GitHub Desktop.
Various rspec commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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