diff options
Diffstat (limited to 'spec/support/helpers.rb')
-rw-r--r-- | spec/support/helpers.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index d179ea3b..cf8c6d2e 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -66,9 +66,9 @@ module Spec requires = options.delete(:requires) || [] requires << File.expand_path("../fakeweb/"+options.delete(:fakeweb)+".rb", __FILE__) if options.key?(:fakeweb) requires << File.expand_path("../artifice/"+options.delete(:artifice)+".rb", __FILE__) if options.key?(:artifice) - requires_str = requires.map{|r| "-r#{r}"}.join(" ") + requires_str = requires.map{|r| "-r#{r}" }.join(" ") - env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}'"}.join(" ") + env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}'" }.join(" ") args = options.map do |k, v| v == true ? " --#{k}" : " --#{k} #{v}" if v end.join @@ -86,9 +86,9 @@ module Spec requires = options.delete(:requires) || [] requires << File.expand_path("../fakeweb/"+options.delete(:fakeweb)+".rb", __FILE__) if options.key?(:fakeweb) requires << File.expand_path("../artifice/"+options.delete(:artifice)+".rb", __FILE__) if options.key?(:artifice) - requires_str = requires.map{|r| "-r#{r}"}.join(" ") + requires_str = requires.map{|r| "-r#{r}" }.join(" ") - env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' "}.join + env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' " }.join cmd = "#{env}#{Gem.ruby} -I#{lib} #{requires_str} #{bundle_bin}" sys_exec(cmd, expect_err){|i| yield i if block_given? } @@ -96,7 +96,7 @@ module Spec def ruby(ruby, options = {}) expect_err = options.delete(:expect_err) - env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' "}.join + env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' " }.join ruby.gsub!(/["`\$]/) {|m| "\\#{m}" } lib_option = options[:no_lib] ? "" : " -I#{lib}" sys_exec(%{#{env}#{Gem.ruby}#{lib_option} -e "#{ruby}"}, expect_err) @@ -355,7 +355,7 @@ module Spec changed_lines = pathname.readlines.map do |line| yield line end - File.open(pathname, "w") { |file| file.puts(changed_lines.join) } + File.open(pathname, "w") {|file| file.puts(changed_lines.join) } end def with_env_vars(env_hash, &block) |