Created
November 14, 2013 23:22
-
-
Save puyo/7476232 to your computer and use it in GitHub Desktop.
Madness. Complete madness. But it mostly worked. A ghetto version of https://github.com/yujinakayama/transpec ;-)
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
require 'pathname' | |
system('git checkout .') | |
Pathname.glob('spec/**/*_spec.rb') do |path| | |
#next if path.to_s.match(/tsa_open_period_spec|tutor_earning_spec|tutoring_service_agreement_spec|presence_spec/) | |
content = path.read | |
content.gsub!(/\.should ==\s*(.+?)(\s#\s|$)/, %q{.should eq(\1)\2}) | |
content.gsub!(/\.should_not ==\s*(.+?)(\s#\s|$)/, %q{.should_not eq(\1)\2}) | |
# content.gsub!(/^(\s*)(.+)\.should_not_receive/, %q{\1expect(\2).not_to receive}) | |
# content.gsub!(/^(\s*)(.+)\.should_receive/, %q{\1expect(\2).to receive}) | |
content.gsub!(/lambda\s*({.+?}).should_not(\s+)/m, %q{expect\1.not_to\2}) | |
content.gsub!(/lambda\s*({.+?}).should(\s+)/m, %q{expect\1.to\2}) | |
content.gsub!(/^(\s*)(.+)\.should_not(\s+)/, %q{\1expect(\2).not_to\3}) | |
content.gsub!(/^(\s*)(.+)\.should(\s+)/, %q{\1expect(\2).to\3}) | |
path.open('w') { |f| f << content } | |
end | |
system('git diff') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
THANKS FOR NOT HOT LINKING THAT LINK GH
https://github.com/yujinakayama/transpec