diff options
Diffstat (limited to 'spec/bundler/support/helpers.rb')
-rw-r--r-- | spec/bundler/support/helpers.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index 478fe60822..cf76a84b7c 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -548,6 +548,22 @@ module Spec Dir[pattern].each(&chmod[0o755, 0o644]) end + # Simulate replacing TODOs with real values + def prepare_gemspec(pathname) + process_file(pathname) do |line| + case line + when /spec\.metadata\["(?:allowed_push_host|homepage_uri|source_code_uri|changelog_uri)"\]/, /spec\.homepage/ + line.gsub(/\=.*$/, "= 'http://example.org'") + when /spec\.summary/ + line.gsub(/\=.*$/, "= %q{A short summary of my new gem.}") + when /spec\.description/ + line.gsub(/\=.*$/, "= %q{A longer description of my new gem.}") + else + line + end + end + end + def process_file(pathname) changed_lines = pathname.readlines.map do |line| yield line |