Created
February 7, 2017 21:43
-
-
Save jhawthorn/bc9adb2eb91651c6a0ba5c0b787c8014 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
set -e | |
git_changed() { | |
changes=$(git diff) | |
[ -n "$changes" ] | |
} | |
find spec -name '*_spec.rb' | xargs sed -i 's/spree_\(get\|post\|put\|delete\)/\1/g' | |
if git_changed; then | |
git commit -am 'Use normal get/post/put/delete test helpers' || true | |
fi | |
rails5-spec-converter | |
if git_changed; then | |
sed -i '/rails-controller-testing/ a else\n gem "rails_test_params_backport"' Gemfile | |
git commit -am 'Use rails 5 request test syntax' || true | |
sed -i '/rails_test_params_backport/ a \ \ gem "rails", "~> 4.2.7"' Gemfile | |
git commit -am 'Specify rails 4.2 version (bundler workaround)' || true | |
else | |
sed -i '/rails-controller-testing/ a else\n gem "rails", "~> 4.2.7"' Gemfile | |
git commit -am 'Specify rails 4.2 version (bundler workaround)' || true | |
fi | |
Author
jhawthorn
commented
Feb 8, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment