summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-07-15 20:52:48 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-07-15 20:52:48 -0700
commita77ca278809d7f31fa51e4b821faed86324c8275 (patch)
treeda1c6c68b24fdcab9acfc07b6a352a39af1c6f4e /spec/support
parentaf694073229af89af205d24ff449f51f74316a37 (diff)
downloadbundler-a77ca278809d7f31fa51e4b821faed86324c8275.tar.gz
[RuboCop] Enable Style/StringLiterals
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/artifice/endpoint.rb8
-rw-r--r--spec/support/artifice/endpoint_500.rb4
-rw-r--r--spec/support/artifice/endpoint_api_missing.rb2
-rw-r--r--spec/support/artifice/endpoint_creds_diff_host.rb4
-rw-r--r--spec/support/artifice/endpoint_extra_missing.rb2
-rw-r--r--spec/support/artifice/endpoint_host_redirect.rb2
-rw-r--r--spec/support/builders.rb24
-rw-r--r--spec/support/fakeweb/windows.rb10
-rw-r--r--spec/support/hax.rb12
-rw-r--r--spec/support/helpers.rb76
-rw-r--r--spec/support/indexes.rb76
-rw-r--r--spec/support/matchers.rb4
-rw-r--r--spec/support/path.rb4
-rw-r--r--spec/support/platforms.rb10
-rw-r--r--spec/support/rubygems_ext.rb14
-rw-r--r--spec/support/streams.rb2
16 files changed, 127 insertions, 127 deletions
diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb
index 59e80bb8f2..2ac0483ac6 100644
--- a/spec/support/artifice/endpoint.rb
+++ b/spec/support/artifice/endpoint.rb
@@ -8,16 +8,16 @@ $LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/rack-*/lib")].first}"
$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/rack-*/lib")].last}"
$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/tilt*/lib")].first}"
$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/sinatra*/lib")].first}"
-require 'artifice'
-require 'sinatra/base'
+require "artifice"
+require "sinatra/base"
class Endpoint < Sinatra::Base
helpers do
def dependencies_for(gem_names, gem_repo = gem_repo1)
return [] if gem_names.nil? || gem_names.empty?
- require 'rubygems'
- require 'bundler'
+ require "rubygems"
+ require "bundler"
Bundler::Deprecate.skip_during do
Marshal.load(File.open(gem_repo.join("specs.4.8")).read).map do |name, version, platform|
spec = load_spec(name, version, platform, gem_repo)
diff --git a/spec/support/artifice/endpoint_500.rb b/spec/support/artifice/endpoint_500.rb
index 84997db45c..41076bf2c7 100644
--- a/spec/support/artifice/endpoint_500.rb
+++ b/spec/support/artifice/endpoint_500.rb
@@ -7,8 +7,8 @@ $LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/rack-*/lib")].last}"
$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/tilt*/lib")].first}"
$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/sinatra*/lib")].first}"
-require 'artifice'
-require 'sinatra/base'
+require "artifice"
+require "sinatra/base"
Artifice.deactivate
diff --git a/spec/support/artifice/endpoint_api_missing.rb b/spec/support/artifice/endpoint_api_missing.rb
index bc89db3608..ca5916938f 100644
--- a/spec/support/artifice/endpoint_api_missing.rb
+++ b/spec/support/artifice/endpoint_api_missing.rb
@@ -5,7 +5,7 @@ Artifice.deactivate
class EndpointApiMissing < Endpoint
get "/fetch/actual/gem/:id" do
$stderr.puts params[:id]
- if params[:id] == 'rack-1.0.gemspec.rz'
+ if params[:id] == "rack-1.0.gemspec.rz"
halt 404
else
File.read("#{gem_repo2}/quick/Marshal.4.8/#{params[:id]}")
diff --git a/spec/support/artifice/endpoint_creds_diff_host.rb b/spec/support/artifice/endpoint_creds_diff_host.rb
index 21cce22955..b97a19435d 100644
--- a/spec/support/artifice/endpoint_creds_diff_host.rb
+++ b/spec/support/artifice/endpoint_creds_diff_host.rb
@@ -9,12 +9,12 @@ class EndpointCredsDiffHost < Endpoint
end
def authorized?
- auth.provided? && auth.basic? && auth.credentials && auth.credentials == ['user', 'pass']
+ auth.provided? && auth.basic? && auth.credentials && auth.credentials == ["user", "pass"]
end
def protected!
unless authorized?
- response['WWW-Authenticate'] = %(Basic realm="Testing HTTP Auth")
+ response["WWW-Authenticate"] = %(Basic realm="Testing HTTP Auth")
throw(:halt, [401, "Not authorized\n"])
end
end
diff --git a/spec/support/artifice/endpoint_extra_missing.rb b/spec/support/artifice/endpoint_extra_missing.rb
index 29322ad221..89c4c0c776 100644
--- a/spec/support/artifice/endpoint_extra_missing.rb
+++ b/spec/support/artifice/endpoint_extra_missing.rb
@@ -4,7 +4,7 @@ Artifice.deactivate
class EndpointExtraMissing < EndpointExtra
get "/extra/fetch/actual/gem/:id" do
- if params[:id] == 'missing-1.0.gemspec.rz'
+ if params[:id] == "missing-1.0.gemspec.rz"
halt 404
else
File.read("#{gem_repo2}/quick/Marshal.4.8/#{params[:id]}")
diff --git a/spec/support/artifice/endpoint_host_redirect.rb b/spec/support/artifice/endpoint_host_redirect.rb
index e44d63e2a6..00c496af58 100644
--- a/spec/support/artifice/endpoint_host_redirect.rb
+++ b/spec/support/artifice/endpoint_host_redirect.rb
@@ -3,7 +3,7 @@ require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
class EndpointHostRedirect < Endpoint
- get "/fetch/actual/gem/:id", :host_name => 'localgemserver.test' do
+ get "/fetch/actual/gem/:id", :host_name => "localgemserver.test" do
redirect "http://bundler.localgemserver.test#{request.path_info}"
end
diff --git a/spec/support/builders.rb b/spec/support/builders.rb
index a76cbc21a5..4d7ad44418 100644
--- a/spec/support/builders.rb
+++ b/spec/support/builders.rb
@@ -1,9 +1,9 @@
-require 'bundler/shared_helpers'
+require "bundler/shared_helpers"
module Spec
module Builders
def self.constantize(name)
- name.gsub('-', '').upcase
+ name.gsub("-", "").upcase
end
def v(version)
@@ -285,8 +285,8 @@ module Spec
build_gem "rack"
build_gem "signed_gem" do |s|
- cert = 'signing-cert.pem'
- pkey = 'signing-pkey.pem'
+ cert = "signing-cert.pem"
+ pkey = "signing-pkey.pem"
s.write cert, TEST_CERT
s.write pkey, TEST_PKEY
s.signing_key = pkey
@@ -446,8 +446,8 @@ module Spec
s.description = "This is a completely fake gem, for testing purposes."
s.author = "no one"
s.email = "foo@bar.baz"
- s.homepage = 'http://example.com'
- s.license = 'MIT'
+ s.homepage = "http://example.com"
+ s.license = "MIT"
end
@files = {}
end
@@ -470,7 +470,7 @@ module Spec
end
def add_c_extension
- require_paths << 'ext'
+ require_paths << "ext"
extensions << "ext/extconf.rb"
write "ext/extconf.rb", <<-RUBY
require "mkmf"
@@ -517,7 +517,7 @@ module Spec
@files.each do |file, source|
file = Pathname.new(path).join(file)
FileUtils.mkdir_p(file.dirname)
- File.open(file, 'w') { |f| f.puts source }
+ File.open(file, "w") { |f| f.puts source }
end
@spec.files = @files.keys
path
@@ -528,7 +528,7 @@ module Spec
end
def _default_path
- @context.tmp('libs', @spec.full_name)
+ @context.tmp("libs", @spec.full_name)
end
end
@@ -637,11 +637,11 @@ module Spec
end
def _default_path
- @context.gem_repo1('gems')
+ @context.gem_repo1("gems")
end
end
- TEST_CERT = <<-CERT.gsub(/^\s*/, '')
+ TEST_CERT = <<-CERT.gsub(/^\s*/, "")
-----BEGIN CERTIFICATE-----
MIIDMjCCAhqgAwIBAgIBATANBgkqhkiG9w0BAQUFADAnMQwwCgYDVQQDDAN5b3Ux
FzAVBgoJkiaJk/IsZAEZFgdleGFtcGxlMB4XDTE1MDIwODAwMTIyM1oXDTQyMDYy
@@ -664,7 +664,7 @@ module Spec
-----END CERTIFICATE-----
CERT
- TEST_PKEY = <<-PKEY.gsub(/^\s*/, '')
+ TEST_PKEY = <<-PKEY.gsub(/^\s*/, "")
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA2W8V2k3jdzgMxL0mjTqbRruTdtDcdZDXKtiFkyLvsXUXvc2k
GSdgcjMOS1CkafqGz/hAUlPibjM0QEXjtQuMdTmdMrmuORLeeIZhSO+HdkTNV6j3
diff --git a/spec/support/fakeweb/windows.rb b/spec/support/fakeweb/windows.rb
index 0a5dfcb459..02be5d6cc3 100644
--- a/spec/support/fakeweb/windows.rb
+++ b/spec/support/fakeweb/windows.rb
@@ -1,14 +1,14 @@
require File.expand_path("../../path.rb", __FILE__)
include Spec::Path
-files = [ 'specs.4.8.gz',
- 'prerelease_specs.4.8.gz',
- 'quick/Marshal.4.8/rcov-1.0-mswin32.gemspec.rz',
- 'gems/rcov-1.0-mswin32.gem' ]
+files = [ "specs.4.8.gz",
+ "prerelease_specs.4.8.gz",
+ "quick/Marshal.4.8/rcov-1.0-mswin32.gemspec.rz",
+ "gems/rcov-1.0-mswin32.gem" ]
# Set up pretend http gem server with FakeWeb
$LOAD_PATH.unshift "#{Dir[base_system_gems.join("gems/fakeweb*/lib")].first}"
-require 'fakeweb'
+require "fakeweb"
FakeWeb.allow_net_connect = false
diff --git a/spec/support/hax.rb b/spec/support/hax.rb
index a473768531..4c456f6fbb 100644
--- a/spec/support/hax.rb
+++ b/spec/support/hax.rb
@@ -1,19 +1,19 @@
-require 'rubygems'
+require "rubygems"
class Gem::Platform
- @local = new(ENV['BUNDLER_SPEC_PLATFORM']) if ENV['BUNDLER_SPEC_PLATFORM']
+ @local = new(ENV["BUNDLER_SPEC_PLATFORM"]) if ENV["BUNDLER_SPEC_PLATFORM"]
end
-if ENV['BUNDLER_SPEC_VERSION']
+if ENV["BUNDLER_SPEC_VERSION"]
module Bundler
- VERSION = ENV['BUNDLER_SPEC_VERSION'].dup
+ VERSION = ENV["BUNDLER_SPEC_VERSION"].dup
end
end
class Object
- if ENV['BUNDLER_SPEC_RUBY_ENGINE']
+ if ENV["BUNDLER_SPEC_RUBY_ENGINE"]
remove_const :RUBY_ENGINE if defined?(RUBY_ENGINE)
- RUBY_ENGINE = ENV['BUNDLER_SPEC_RUBY_ENGINE']
+ RUBY_ENGINE = ENV["BUNDLER_SPEC_RUBY_ENGINE"]
if RUBY_ENGINE == "jruby"
JRUBY_VERSION = ENV["BUNDLER_SPEC_RUBY_ENGINE_VERSION"]
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index d074a5e0bb..d179ea3ba0 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -4,7 +4,7 @@ module Spec
@in_p, @out_p, @err_p = nil, nil, nil
Dir["#{tmp}/{gems/*,*}"].each do |dir|
next if %(base remote1 gems rubygems).include?(File.basename(dir))
- if ENV['BUNDLER_SUDO_TESTS']
+ if ENV["BUNDLER_SUDO_TESTS"]
`sudo rm -rf #{dir}`
else
FileUtils.rm_rf(dir)
@@ -53,7 +53,7 @@ module Spec
end
def lib
- File.expand_path('../../../lib', __FILE__)
+ File.expand_path("../../../lib", __FILE__)
end
def bundle(cmd, options = {})
@@ -61,11 +61,11 @@ module Spec
sudo = "sudo" if options.delete(:sudo)
options["no-color"] = true unless options.key?("no-color") || %w(exec conf).include?(cmd.to_s[0..3])
- bundle_bin = File.expand_path('../../../exe/bundle', __FILE__)
+ bundle_bin = File.expand_path("../../../exe/bundle", __FILE__)
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 << 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(" ")
env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}'"}.join(" ")
@@ -81,11 +81,11 @@ module Spec
expect_err = options.delete(:expect_err)
options["no-color"] = true unless options.key?("no-color")
- bundle_bin = File.expand_path('../../../exe/bundle_ruby', __FILE__)
+ bundle_bin = File.expand_path("../../../exe/bundle_ruby", __FILE__)
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 << 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(" ")
env = (options.delete(:env) || {}).map{|k, v| "#{k}='#{v}' "}.join
@@ -115,11 +115,11 @@ module Spec
def gembin(cmd)
lib = File.expand_path("../../../lib", __FILE__)
- old, ENV['RUBYOPT'] = ENV['RUBYOPT'], "#{ENV['RUBYOPT']} -I#{lib}"
+ old, ENV["RUBYOPT"] = ENV["RUBYOPT"], "#{ENV["RUBYOPT"]} -I#{lib}"
cmd = bundled_app("bin/#{cmd}") unless cmd.to_s.include?("/")
sys_exec(cmd.to_s)
ensure
- ENV['RUBYOPT'] = old
+ ENV["RUBYOPT"] = old
end
def sys_exec(cmd, expect_err = false)
@@ -138,10 +138,10 @@ module Spec
@out
end
- def config(config = nil, path = bundled_app('.bundle/config'))
+ def config(config = nil, path = bundled_app(".bundle/config"))
return YAML.load_file(path) unless config
FileUtils.mkdir_p(File.dirname(path))
- File.open(path, 'w') do |f|
+ File.open(path, "w") do |f|
f.puts config.to_yaml
end
config
@@ -156,7 +156,7 @@ module Spec
path = args.shift if args.first.is_a?(Pathname)
str = args.shift || ""
path.dirname.mkpath
- File.open(path.to_s, 'w') do |f|
+ File.open(path.to_s, "w") do |f|
f.puts strip_whitespace(str)
end
end
@@ -172,7 +172,7 @@ module Spec
def strip_whitespace(str)
# Trim the leading spaces
spaces = str[/\A\s+/, 0] || ""
- str.gsub(/^#{spaces}/, '')
+ str.gsub(/^#{spaces}/, "")
end
def install_gemfile(*args)
@@ -195,19 +195,19 @@ module Spec
alias install_gem install_gems
def with_gem_path_as(path)
- gem_home, gem_path = ENV['GEM_HOME'], ENV['GEM_PATH']
- ENV['GEM_HOME'], ENV['GEM_PATH'] = path.to_s, path.to_s
+ gem_home, gem_path = ENV["GEM_HOME"], ENV["GEM_PATH"]
+ ENV["GEM_HOME"], ENV["GEM_PATH"] = path.to_s, path.to_s
yield
ensure
- ENV['GEM_HOME'], ENV['GEM_PATH'] = gem_home, gem_path
+ ENV["GEM_HOME"], ENV["GEM_PATH"] = gem_home, gem_path
end
def with_path_as(path)
- old_path = ENV['PATH']
- ENV['PATH'] = "#{path}:#{ENV['PATH']}"
+ old_path = ENV["PATH"]
+ ENV["PATH"] = "#{path}:#{ENV["PATH"]}"
yield
ensure
- ENV['PATH'] = old_path
+ ENV["PATH"] = old_path
end
def break_git!
@@ -240,16 +240,16 @@ module Spec
Gem.clear_paths
- gem_home, gem_path, path = ENV['GEM_HOME'], ENV['GEM_PATH'], ENV['PATH']
- ENV['GEM_HOME'], ENV['GEM_PATH'] = system_gem_path.to_s, system_gem_path.to_s
+ gem_home, gem_path, path = ENV["GEM_HOME"], ENV["GEM_PATH"], ENV["PATH"]
+ ENV["GEM_HOME"], ENV["GEM_PATH"] = system_gem_path.to_s, system_gem_path.to_s
install_gems(*gems)
if block_given?
begin
yield
ensure
- ENV['GEM_HOME'], ENV['GEM_PATH'] = gem_home, gem_path
- ENV['PATH'] = path
+ ENV["GEM_HOME"], ENV["GEM_PATH"] = gem_home, gem_path
+ ENV["PATH"] = path
end
end
end
@@ -262,8 +262,8 @@ module Spec
Gem.clear_paths
- gem_home, gem_path, path = ENV['GEM_HOME'], ENV['GEM_PATH'], ENV['PATH']
- ENV['GEM_HOME'], ENV['GEM_PATH'] = system_gem_path.to_s, system_gem_path.to_s
+ gem_home, gem_path, path = ENV["GEM_HOME"], ENV["GEM_PATH"], ENV["PATH"]
+ ENV["GEM_HOME"], ENV["GEM_PATH"] = system_gem_path.to_s, system_gem_path.to_s
gems.each do |gem|
gem_command :install, "--no-rdoc --no-ri #{gem}"
@@ -272,8 +272,8 @@ module Spec
begin
yield
ensure
- ENV['GEM_HOME'], ENV['GEM_PATH'] = gem_home, gem_path
- ENV['PATH'] = path
+ ENV["GEM_HOME"], ENV["GEM_PATH"] = gem_home, gem_path
+ ENV["PATH"] = path
end
end
end
@@ -294,32 +294,32 @@ module Spec
def simulate_new_machine
system_gems []
FileUtils.rm_rf default_bundle_path
- FileUtils.rm_rf bundled_app('.bundle')
+ FileUtils.rm_rf bundled_app(".bundle")
end
def simulate_platform(platform)
- old, ENV['BUNDLER_SPEC_PLATFORM'] = ENV['BUNDLER_SPEC_PLATFORM'], platform.to_s
+ old, ENV["BUNDLER_SPEC_PLATFORM"] = ENV["BUNDLER_SPEC_PLATFORM"], platform.to_s
yield if block_given?
ensure
- ENV['BUNDLER_SPEC_PLATFORM'] = old if block_given?
+ ENV["BUNDLER_SPEC_PLATFORM"] = old if block_given?
end
def simulate_ruby_engine(engine, version = "1.6.0")
return if engine == local_ruby_engine
- old, ENV['BUNDLER_SPEC_RUBY_ENGINE'] = ENV['BUNDLER_SPEC_RUBY_ENGINE'], engine
- old_version, ENV['BUNDLER_SPEC_RUBY_ENGINE_VERSION'] = ENV['BUNDLER_SPEC_RUBY_ENGINE_VERSION'], version
+ old, ENV["BUNDLER_SPEC_RUBY_ENGINE"] = ENV["BUNDLER_SPEC_RUBY_ENGINE"], engine
+ old_version, ENV["BUNDLER_SPEC_RUBY_ENGINE_VERSION"] = ENV["BUNDLER_SPEC_RUBY_ENGINE_VERSION"], version
yield if block_given?
ensure
- ENV['BUNDLER_SPEC_RUBY_ENGINE'] = old if block_given?
- ENV['BUNDLER_SPEC_RUBY_ENGINE_VERSION'] = old_version if block_given?
+ ENV["BUNDLER_SPEC_RUBY_ENGINE"] = old if block_given?
+ ENV["BUNDLER_SPEC_RUBY_ENGINE_VERSION"] = old_version if block_given?
end
def simulate_bundler_version(version)
- old, ENV['BUNDLER_SPEC_VERSION'] = ENV['BUNDLER_SPEC_VERSION'], version.to_s
+ old, ENV["BUNDLER_SPEC_VERSION"] = ENV["BUNDLER_SPEC_VERSION"], version.to_s
yield if block_given?
ensure
- ENV['BUNDLER_SPEC_VERSION'] = old if block_given?
+ ENV["BUNDLER_SPEC_VERSION"] = old if block_given?
end
def revision_for(path)
@@ -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)
diff --git a/spec/support/indexes.rb b/spec/support/indexes.rb
index ea549aaccb..9761a2cbba 100644
--- a/spec/support/indexes.rb
+++ b/spec/support/indexes.rb
@@ -13,7 +13,7 @@ module Spec
alias platforms platform
def resolve
- @platforms ||= ['ruby']
+ @platforms ||= ["ruby"]
deps = []
@deps.each do |d|
@platforms.each do |p|
@@ -60,22 +60,22 @@ module Spec
gem "activesupport", version
gem "actionpack", version do
dep "activesupport", version
- if version >= v('3.0.0.beta')
- dep "rack", '~> 1.1'
+ if version >= v("3.0.0.beta")
+ dep "rack", "~> 1.1"
dep "rack-mount", ">= 0.5"
- elsif version > v('2.3') then dep "rack", '~> 1.0.0'
- elsif version > v('2.0.0') then dep "rack", '~> 0.9.0'
+ elsif version > v("2.3") then dep "rack", "~> 1.0.0"
+ elsif version > v("2.0.0") then dep "rack", "~> 0.9.0"
end
end
gem "activerecord", version do
dep "activesupport", version
- dep "arel", ">= 0.2" if version >= v('3.0.0.beta')
+ dep "arel", ">= 0.2" if version >= v("3.0.0.beta")
end
gem "actionmailer", version do
dep "activesupport", version
dep "actionmailer", version
end
- if version < v('3.0.0.beta')
+ if version < v("3.0.0.beta")
gem "railties", version do
dep "activerecord", version
dep "actionpack", version
@@ -94,22 +94,22 @@ module Spec
end
end
- versions '1.0 1.2 1.2.1 1.2.2 1.3 1.3.0.1 1.3.5 1.4.0 1.4.2 1.4.2.1' do |version|
+ versions "1.0 1.2 1.2.1 1.2.2 1.3 1.3.0.1 1.3.5 1.4.0 1.4.2 1.4.2.1" do |version|
platforms "ruby java mswin32 mingw32 x64-mingw32" do |platform|
- next if version == v('1.4.2.1') && platform != pl('x86-mswin32')
- next if version == v('1.4.2') && platform == pl('x86-mswin32')
+ next if version == v("1.4.2.1") && platform != pl("x86-mswin32")
+ next if version == v("1.4.2") && platform == pl("x86-mswin32")
gem "nokogiri", version, platform do
- dep "weakling", ">= 0.0.3" if platform =~ pl('java')
+ dep "weakling", ">= 0.0.3" if platform =~ pl("java")
end
end
end
- versions '0.0.1 0.0.2 0.0.3' do |version|
+ versions "0.0.1 0.0.2 0.0.3" do |version|
gem "weakling", version
end
# --- Rails related
- versions '1.2.3 2.2.3 2.3.5' do |version|
+ versions "1.2.3 2.2.3 2.3.5" do |version|
gem "activemerchant", version do
dep "activesupport", ">= #{version}"
end
@@ -122,17 +122,17 @@ module Spec
def a_conflict_index
build_index do
gem "builder", %w(3.0.4 3.1.4)
- gem("grape", '0.2.6') do
+ gem("grape", "0.2.6") do
dep "builder", ">= 0"
end
- versions '3.2.8 3.2.9 3.2.10 3.2.11' do |version|
+ versions "3.2.8 3.2.9 3.2.10 3.2.11" do |version|
gem("activemodel", version) do
dep "builder", "~> 3.0.0"
end
end
- gem("my_app", '1.0.0') do
+ gem("my_app", "1.0.0") do
dep "activemodel", ">= 0"
dep "grape", ">= 0"
end
@@ -151,35 +151,35 @@ module Spec
gem "d", "0.9.8"
- gem("b", '0.3.4') do
+ gem("b", "0.3.4") do
dep "a", ">= 1.5.0"
end
- gem("b", '0.3.5') do
+ gem("b", "0.3.5") do
dep "a", ">= 1.2"
end
- gem("b", '0.3.3') do
+ gem("b", "0.3.3") do
dep "a", "> 1.0"
end
- versions '3.2 3.3' do |version|
+ versions "3.2 3.3" do |version|
gem("c", version) do
dep "a", "~> 1.0"
end
end
- gem("my_app", '1.3.0') do
+ gem("my_app", "1.3.0") do
dep "c", ">= 4.0"
dep "b", ">= 0"
end
- gem("my_app", '1.2.0') do
+ gem("my_app", "1.2.0") do
dep "c", "~> 3.3.0"
dep "b", "0.3.4"
end
- gem("my_app", '1.1.0') do
+ gem("my_app", "1.1.0") do
dep "c", "~> 3.2.0"
dep "b", "0.3.5"
end
@@ -190,7 +190,7 @@ module Spec
build_index do
gem "json", %w(1.6.5 1.7.7 1.8.0)
- gem("chef", '10.26') do
+ gem("chef", "10.26") do
dep "json", [">= 1.4.4", "<= 1.7.7"]
end
@@ -198,7 +198,7 @@ module Spec
dep "json", ">= 1.7.7"
end
- gem("chef_app", '1.0.0') do
+ gem("chef_app", "1.0.0") do
dep "berkshelf", "~> 2.0"
dep "chef", "~> 10.26"
end
@@ -272,7 +272,7 @@ module Spec
build_index do
gem "json", %w(1.8.0)
- gem("chef", '10.26') do
+ gem("chef", "10.26") do
dep "json", [">= 1.4.4", "<= 1.7.7"]
end
@@ -280,7 +280,7 @@ module Spec
dep "json", ">= 1.7.7"
end
- gem("chef_app_error", '1.0.0') do
+ gem("chef_app_error", "1.0.0") do
dep "berkshelf", "~> 2.0"
dep "chef", "~> 10.26"
end
@@ -294,35 +294,35 @@ module Spec
gem "activesupport", %w(3.0.0 3.0.1 3.0.5 3.1.7)
- gem("activemodel", '3.0.5') do
+ gem("activemodel", "3.0.5") do
dep "activesupport", "= 3.0.5"
dep "builder", "~> 2.1.2"
- dep 'i18n', '~> 0.4'
+ dep "i18n", "~> 0.4"
end
- gem("activemodel", '3.0.0') do
+ gem("activemodel", "3.0.0") do
dep "activesupport", "= 3.0.0"
dep "builder", "~> 2.1.2"
- dep 'i18n', '~> 0.4.1'
+ dep "i18n", "~> 0.4.1"
end
- gem("activemodel", '3.1.3') do
+ gem("activemodel", "3.1.3") do
dep "activesupport", "= 3.1.3"
dep "builder", "~> 2.1.2"
- dep 'i18n', '~> 0.5'
+ dep "i18n", "~> 0.5"
end
- gem("activerecord", '3.0.0') do
+ gem("activerecord", "3.0.0") do
dep "activesupport", "= 3.0.0"
dep "activemodel", "= 3.0.0"
end
- gem("activerecord", '3.0.5') do
+ gem("activerecord", "3.0.5") do
dep "activesupport", "= 3.0.5"
dep "activemodel", "= 3.0.5"
end
- gem("activerecord", '3.0.9') do
+ gem("activerecord", "3.0.9") do
dep "activesupport", "= 3.1.5"
dep "activemodel", "= 3.1.5"
end
@@ -332,7 +332,7 @@ module Spec
def a_circular_index
build_index do
gem "rack", "1.0.1"
- gem("foo", '0.2.6') do
+ gem("foo", "0.2.6") do
dep "bar", ">= 0"
end
@@ -340,7 +340,7 @@ module Spec
dep "foo", ">= 0"
end
- gem("circular_app", '1.0.0') do
+ gem("circular_app", "1.0.0") do
dep "foo", ">= 0"
dep "bar", ">= 0"
end
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
index e42c67be57..b4b18e7839 100644
--- a/spec/support/matchers.rb
+++ b/spec/support/matchers.rb
@@ -32,7 +32,7 @@ module Spec
groups << opts
names.each do |name|
name, version, platform = name.split(/\s+/)
- version_const = name == 'bundler' ? 'Bundler::VERSION' : Spec::Builders.constantize(name)
+ version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name)
run "require '#{name}.rb'; puts #{version_const}", *groups
actual_version, actual_platform = out.split(/\s+/)
expect(Gem::Version.new(actual_version)).to eq(Gem::Version.new(version))
@@ -70,7 +70,7 @@ module Spec
def lockfile_should_be(expected)
should_be_locked
spaces = expected[/\A\s+/, 0] || ""
- expected.gsub!(/^#{spaces}/, '')
+ 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 56e8dd8b41..21d95a6064 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -1,4 +1,4 @@
-require 'pathname'
+require "pathname"
module Spec
module Path
@@ -77,7 +77,7 @@ module Spec
end
def bundler_path
- Pathname.new(File.expand_path('../../../lib', __FILE__))
+ Pathname.new(File.expand_path("../../../lib", __FILE__))
end
extend self
diff --git a/spec/support/platforms.rb b/spec/support/platforms.rb
index b574d63ccb..4e73ff82aa 100644
--- a/spec/support/platforms.rb
+++ b/spec/support/platforms.rb
@@ -7,7 +7,7 @@ module Spec
end
def mac
- Gem::Platform.new('x86-darwin-10')
+ Gem::Platform.new("x86-darwin-10")
end
def java
@@ -15,19 +15,19 @@ module Spec
end
def linux
- Gem::Platform.new(['x86', 'linux', nil])
+ Gem::Platform.new(["x86", "linux", nil])
end
def mswin
- Gem::Platform.new(['x86', 'mswin32', nil])
+ Gem::Platform.new(["x86", "mswin32", nil])
end
def mingw
- Gem::Platform.new(['x86', 'mingw32', nil])
+ Gem::Platform.new(["x86", "mingw32", nil])
end
def x64_mingw
- Gem::Platform.new(['x64', 'mingw32', nil])
+ Gem::Platform.new(["x64", "mingw32", nil])
end
def all_platforms
diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb
index 0d0e35c452..5456ad2e90 100644
--- a/spec/support/rubygems_ext.rb
+++ b/spec/support/rubygems_ext.rb
@@ -1,14 +1,14 @@
-require 'rubygems/user_interaction'
-require 'support/path' unless defined?(Spec::Path)
+require "rubygems/user_interaction"
+require "support/path" unless defined?(Spec::Path)
module Spec
module Rubygems
def self.setup
Gem.clear_paths
- ENV['BUNDLE_PATH'] = nil
- ENV['GEM_HOME'] = ENV['GEM_PATH'] = Path.base_system_gems.to_s
- ENV['PATH'] = ["#{Path.root}/exe", "#{Path.system_gem_path}/bin", ENV['PATH']].join(File::PATH_SEPARATOR)
+ ENV["BUNDLE_PATH"] = nil
+ ENV["GEM_HOME"] = ENV["GEM_PATH"] = Path.base_system_gems.to_s
+ ENV["PATH"] = ["#{Path.root}/exe", "#{Path.system_gem_path}/bin", ENV["PATH"]].join(File::PATH_SEPARATOR)
unless File.exist?("#{Path.base_system_gems}")
FileUtils.mkdir_p(Path.base_system_gems)
@@ -24,7 +24,7 @@ module Spec
`gem install ruby-graphviz --no-rdoc --no-ri` if RUBY_VERSION >= "1.9.3"
end
- ENV['HOME'] = Path.home.to_s
+ ENV["HOME"] = Path.home.to_s
Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
end
@@ -34,7 +34,7 @@ module Spec
args = args.gsub(/(?=")/, "\\")
args = %["#{args}"]
end
- lib = File.join(File.dirname(__FILE__), '..', '..', 'lib')
+ lib = File.join(File.dirname(__FILE__), "..", "..", "lib")
%x{#{Gem.ruby} -I#{lib} -rubygems -S gem --backtrace #{command} #{args}}.strip
end
end
diff --git a/spec/support/streams.rb b/spec/support/streams.rb
index 10e1d44cf5..6a0995133f 100644
--- a/spec/support/streams.rb
+++ b/spec/support/streams.rb
@@ -1,4 +1,4 @@
-require 'stringio'
+require "stringio"
def capture(*streams)
streams.map!(&:to_s)