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
# Include this in your spec_helper.rb: | |
config.expect_with :rspec do |c| | |
c.syntax = :expect | |
end | |
# Then, run: | |
find spec -name "*.rb" -exec gsed -i -e "s/\(\s\+\)\(.*\)\.should_not /\1expect(\2).not_to /g" -e "s/\(\s\+\)\(.*\)\.should /\1expect(\2).to /g" -e "s/\(\s\+\)\(.*\)\.should_receive/\1expect(\2).to receive/g" -e "s/\(\s\+\)\(.*\)\.should_not_receive/\1expect(\2).to_not receive/g" "{}" \; | |
# About RSpec's New Expectation Syntax |
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
# For https://github.com/guard/guard/blob/master/CHANGELOG.md | |
input, output, people = File.read('CHANGELOG.md'), "", {} | |
input.each_line do |line| | |
if found = line.match(/\[@(\w+)\]\(([\w:\/.]+)\)/) | |
user, url = found[1], found[2] | |
people[user] = url unless people.include?(user) | |
end | |
end |