diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 11:29:09 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 22:22:06 -0600 |
commit | 7ae072865e3fc23d9844322dde6ad0f6906e3f2c (patch) | |
tree | 2133b2f27e243af2d8beda66f19b2f1086685a0e /spec/support | |
parent | b1afbe3a2ff7623c9a0e8504bc85af4bd8156059 (diff) | |
download | bundler-7ae072865e3fc23d9844322dde6ad0f6906e3f2c.tar.gz |
Compatibility with frozen string literals
Diffstat (limited to 'spec/support')
44 files changed, 49 insertions, 6 deletions
diff --git a/spec/support/artifice/compact_index.rb b/spec/support/artifice/compact_index.rb index eb17f019..88706c35 100644 --- a/spec/support/artifice/compact_index.rb +++ b/spec/support/artifice/compact_index.rb @@ -48,7 +48,7 @@ class CompactIndexAPI < Endpoint end def quote(string) - '"' << string << '"' + %("#{string}") end def parse_etags(value) diff --git a/spec/support/artifice/compact_index_api_missing.rb b/spec/support/artifice/compact_index_api_missing.rb index db6528b8..6d15b54b 100644 --- a/spec/support/artifice/compact_index_api_missing.rb +++ b/spec/support/artifice/compact_index_api_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_basic_authentication.rb b/spec/support/artifice/compact_index_basic_authentication.rb index 5ddcdf7f..bffb5b9e 100644 --- a/spec/support/artifice/compact_index_basic_authentication.rb +++ b/spec/support/artifice/compact_index_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_creds_diff_host.rb b/spec/support/artifice/compact_index_creds_diff_host.rb index 2e8cd46b..0c417f05 100644 --- a/spec/support/artifice/compact_index_creds_diff_host.rb +++ b/spec/support/artifice/compact_index_creds_diff_host.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra.rb b/spec/support/artifice/compact_index_extra.rb index 3300b706..8a87fc43 100644 --- a/spec/support/artifice/compact_index_extra.rb +++ b/spec/support/artifice/compact_index_extra.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra_api.rb b/spec/support/artifice/compact_index_extra_api.rb index df467439..063e5589 100644 --- a/spec/support/artifice/compact_index_extra_api.rb +++ b/spec/support/artifice/compact_index_extra_api.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra_missing.rb b/spec/support/artifice/compact_index_extra_missing.rb index 48fffd51..2af5ce9c 100644 --- a/spec/support/artifice/compact_index_extra_missing.rb +++ b/spec/support/artifice/compact_index_extra_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index_extra", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_forbidden.rb b/spec/support/artifice/compact_index_forbidden.rb index 09d03bc8..b25eea94 100644 --- a/spec/support/artifice/compact_index_forbidden.rb +++ b/spec/support/artifice/compact_index_forbidden.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_host_redirect.rb b/spec/support/artifice/compact_index_host_redirect.rb index 2e53cc78..6c1ab2de 100644 --- a/spec/support/artifice/compact_index_host_redirect.rb +++ b/spec/support/artifice/compact_index_host_redirect.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_redirects.rb b/spec/support/artifice/compact_index_redirects.rb index 256e73d7..ff1d3e43 100644 --- a/spec/support/artifice/compact_index_redirects.rb +++ b/spec/support/artifice/compact_index_redirects.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_strict_basic_authentication.rb b/spec/support/artifice/compact_index_strict_basic_authentication.rb index bb1e794b..49a072d2 100644 --- a/spec/support/artifice/compact_index_strict_basic_authentication.rb +++ b/spec/support/artifice/compact_index_strict_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb b/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb index 205b2588..f1f8dc57 100644 --- a/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +++ b/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_marshal_fail", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb index 847f1d4b..b0e9bd0f 100644 --- a/spec/support/artifice/endpoint.rb +++ b/spec/support/artifice/endpoint.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../../path.rb", __FILE__) require File.expand_path("../../../../lib/bundler/deprecate", __FILE__) include Spec::Path diff --git a/spec/support/artifice/endpoint_500.rb b/spec/support/artifice/endpoint_500.rb index 2812a0d2..9bbbd1e2 100644 --- a/spec/support/artifice/endpoint_500.rb +++ b/spec/support/artifice/endpoint_500.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../../path.rb", __FILE__) include Spec::Path diff --git a/spec/support/artifice/endpoint_api_forbidden.rb b/spec/support/artifice/endpoint_api_forbidden.rb index f9d28c04..21ad9117 100644 --- a/spec/support/artifice/endpoint_api_forbidden.rb +++ b/spec/support/artifice/endpoint_api_forbidden.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_api_missing.rb b/spec/support/artifice/endpoint_api_missing.rb index ca591693..6f5b5f13 100644 --- a/spec/support/artifice/endpoint_api_missing.rb +++ b/spec/support/artifice/endpoint_api_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_basic_authentication.rb b/spec/support/artifice/endpoint_basic_authentication.rb index 0cfba891..9fafd51a 100644 --- a/spec/support/artifice/endpoint_basic_authentication.rb +++ b/spec/support/artifice/endpoint_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_creds_diff_host.rb b/spec/support/artifice/endpoint_creds_diff_host.rb index 97a81d97..cd152848 100644 --- a/spec/support/artifice/endpoint_creds_diff_host.rb +++ b/spec/support/artifice/endpoint_creds_diff_host.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra.rb b/spec/support/artifice/endpoint_extra.rb index c50428fe..ed4e87e6 100644 --- a/spec/support/artifice/endpoint_extra.rb +++ b/spec/support/artifice/endpoint_extra.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra_api.rb b/spec/support/artifice/endpoint_extra_api.rb index d6d1c5a1..1e9e1dc6 100644 --- a/spec/support/artifice/endpoint_extra_api.rb +++ b/spec/support/artifice/endpoint_extra_api.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra_missing.rb b/spec/support/artifice/endpoint_extra_missing.rb index 89c4c0c7..dc79705a 100644 --- a/spec/support/artifice/endpoint_extra_missing.rb +++ b/spec/support/artifice/endpoint_extra_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_extra", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_fallback.rb b/spec/support/artifice/endpoint_fallback.rb index db02a887..8a85a417 100644 --- a/spec/support/artifice/endpoint_fallback.rb +++ b/spec/support/artifice/endpoint_fallback.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_host_redirect.rb b/spec/support/artifice/endpoint_host_redirect.rb index 00c496af..250416d8 100644 --- a/spec/support/artifice/endpoint_host_redirect.rb +++ b/spec/support/artifice/endpoint_host_redirect.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_marshal_fail.rb b/spec/support/artifice/endpoint_marshal_fail.rb index a0dc182e..0fb75ebf 100644 --- a/spec/support/artifice/endpoint_marshal_fail.rb +++ b/spec/support/artifice/endpoint_marshal_fail.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_fallback", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_mirror_source.rb b/spec/support/artifice/endpoint_mirror_source.rb index 39cd3656..9fb58ecb 100644 --- a/spec/support/artifice/endpoint_mirror_source.rb +++ b/spec/support/artifice/endpoint_mirror_source.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) class EndpointMirrorSource < Endpoint diff --git a/spec/support/artifice/endpoint_redirect.rb b/spec/support/artifice/endpoint_redirect.rb index 2b48fa53..f80d7600 100644 --- a/spec/support/artifice/endpoint_redirect.rb +++ b/spec/support/artifice/endpoint_redirect.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_strict_basic_authentication.rb b/spec/support/artifice/endpoint_strict_basic_authentication.rb index e7329abd..4b32cbbf 100644 --- a/spec/support/artifice/endpoint_strict_basic_authentication.rb +++ b/spec/support/artifice/endpoint_strict_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_timeout.rb b/spec/support/artifice/endpoint_timeout.rb index da682204..b15650f2 100644 --- a/spec/support/artifice/endpoint_timeout.rb +++ b/spec/support/artifice/endpoint_timeout.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_fallback", __FILE__) Artifice.deactivate diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 4f5dace6..3a18cbea 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/shared_helpers" module Spec @@ -624,7 +625,7 @@ module Spec current_ref = `git rev-parse HEAD`.strip _default_files.keys.each do |path| - _default_files[path] << "\n#{Builders.constantize(name)}_PREV_REF = '#{current_ref}'" + _default_files[path] += "\n#{Builders.constantize(name)}_PREV_REF = '#{current_ref}'" end super(options.merge(:path => libpath, :gemspec => false)) `git add *` diff --git a/spec/support/code_climate.rb b/spec/support/code_climate.rb index cfcd890a..8f1fb35b 100644 --- a/spec/support/code_climate.rb +++ b/spec/support/code_climate.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module CodeClimate def self.setup diff --git a/spec/support/fakeweb/windows.rb b/spec/support/fakeweb/windows.rb index 6c674b31..f1f21eed 100644 --- a/spec/support/fakeweb/windows.rb +++ b/spec/support/fakeweb/windows.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../../path.rb", __FILE__) include Spec::Path diff --git a/spec/support/hax.rb b/spec/support/hax.rb index 1fd3ae99..2cca22c6 100644 --- a/spec/support/hax.rb +++ b/spec/support/hax.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rubygems" class Gem::Platform diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 8aade71a..8bcae2a4 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Helpers def reset! @@ -122,7 +123,7 @@ module Spec def ruby(ruby, options = {}) expect_err = options.delete(:expect_err) env = (options.delete(:env) || {}).map {|k, v| "#{k}='#{v}' " }.join - ruby.gsub!(/["`\$]/) {|m| "\\#{m}" } + ruby = ruby.gsub(/["`\$]/) {|m| "\\#{m}" } lib_option = options[:no_lib] ? "" : " -I#{lib}" sys_exec(%(#{env}#{Gem.ruby}#{lib_option} -e "#{ruby}"), expect_err) end diff --git a/spec/support/indexes.rb b/spec/support/indexes.rb index 10067197..acace968 100644 --- a/spec/support/indexes.rb +++ b/spec/support/indexes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Indexes def dep(name, reqs = nil) diff --git a/spec/support/less_than_proc.rb b/spec/support/less_than_proc.rb index 51547096..27966aa6 100644 --- a/spec/support/less_than_proc.rb +++ b/spec/support/less_than_proc.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class LessThanProc < Proc attr_accessor :present diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 58babf2c..7047e1be 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Matchers RSpec::Matchers.define :have_dep do |*args| @@ -69,7 +70,7 @@ module Spec def lockfile_should_be(expected) should_be_locked spaces = expected[/\A\s+/, 0] || "" - expected.gsub!(/^#{spaces}/, "") + expected = expected.gsub(/^#{spaces}/, "") expect(bundled_app("Gemfile.lock").read).to eq(expected) end end diff --git a/spec/support/path.rb b/spec/support/path.rb index 42eb9f73..d1f698ac 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "pathname" module Spec diff --git a/spec/support/permissions.rb b/spec/support/permissions.rb index efdb4a5b..f5636dd7 100644 --- a/spec/support/permissions.rb +++ b/spec/support/permissions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Permissions def with_umask(new_umask) diff --git a/spec/support/platforms.rb b/spec/support/platforms.rb index 26753af9..b1dedb05 100644 --- a/spec/support/platforms.rb +++ b/spec/support/platforms.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Platforms include Bundler::GemHelpers diff --git a/spec/support/ruby_ext.rb b/spec/support/ruby_ext.rb index 9c5b08c9..7f1eabf4 100644 --- a/spec/support/ruby_ext.rb +++ b/spec/support/ruby_ext.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class IO def read_available_bytes(chunk_size = 16_384, select_timeout = 0.02) buffer = [] diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb index 2889f440..64cc4144 100644 --- a/spec/support/rubygems_ext.rb +++ b/spec/support/rubygems_ext.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rubygems/user_interaction" require "support/path" unless defined?(Spec::Path) @@ -30,9 +31,9 @@ module Spec if !File.exist?(manifest_path) || !(manifest - File.readlines(manifest_path)).empty? FileUtils.rm_rf(Path.base_system_gems) FileUtils.mkdir_p(Path.base_system_gems) - File.open(manifest_path, "w") {|f| f << manifest.join } puts "installing gems for the tests to use..." DEPS.each {|n, v| install_gem(n, v) } + File.open(manifest_path, "w") {|f| f << manifest.join } end ENV["HOME"] = Path.home.to_s @@ -42,7 +43,7 @@ module Spec def self.install_gem(name, version = nil) cmd = "gem install #{name} --no-rdoc --no-ri" - cmd << " --version #{version}" if version + cmd += " --version #{version}" if version system(cmd) || raise("Installing gem #{name} for the tests to use failed!") end diff --git a/spec/support/sometimes.rb b/spec/support/sometimes.rb index 0ab15d97..1ecbd36e 100644 --- a/spec/support/sometimes.rb +++ b/spec/support/sometimes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Sometimes def run_with_retries(example_to_run, retries) example = RSpec.current_example diff --git a/spec/support/streams.rb b/spec/support/streams.rb index f89c506c..561b2909 100644 --- a/spec/support/streams.rb +++ b/spec/support/streams.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "stringio" def capture(*streams) diff --git a/spec/support/sudo.rb b/spec/support/sudo.rb index 2192b09d..8c82bb8c 100644 --- a/spec/support/sudo.rb +++ b/spec/support/sudo.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Sudo def self.present? |