Created
March 27, 2009 22:48
-
-
Save mhorbul/86952 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
#!/bin/bash | |
# Upgrade to rspec-rails 2.2.2 | |
# response.headers["Status"].should == "201 Created" does not work any more | |
# response.status.should == "201 Created" does work now | |
# | |
# find all controllers specs which contains response.headers["Status"].should | |
# sort them | |
# and remove duplications | |
for c in `grep 'Status' -r spec/controllers | grep 'response.headers' | cut -d':' -f1 | sort | uniq` | |
do | |
# replace all old fashioned lines with the new fashioned ones | |
sed -i.orig -e 's/response\.headers\["Status"\]\.should/response.status.should/' $c | |
done | |
# remove the original copies of the controller specs | |
find spec/controllers -name '*.orig' -exec rm -rf {] \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment