summaryrefslogtreecommitdiff
path: root/spec/resolver
diff options
context:
space:
mode:
authorKoichi ITO <koic.ito@gmail.com>2017-05-09 12:50:44 +0900
committerKoichi ITO <lol@wut.com>2017-05-28 17:25:00 +0900
commitc86d5494da463b01f4953947933022cde15c02cf (patch)
tree3931a29b0e936ec859c697ff068c2297bc82351e /spec/resolver
parent6bfb49ef40cea035407ed01371a960c46c0ad09a (diff)
downloadbundler-c86d5494da463b01f4953947933022cde15c02cf.tar.gz
[RuboCop] Enable Style/PercentLiteralDelimiters
Run `rubocop -a --only Style/PercentLiteralDelimiters` and `rubocop --auto-gen-config`.
Diffstat (limited to 'spec/resolver')
-rw-r--r--spec/resolver/basic_spec.rb60
-rw-r--r--spec/resolver/platform_spec.rb18
2 files changed, 39 insertions, 39 deletions
diff --git a/spec/resolver/basic_spec.rb b/spec/resolver/basic_spec.rb
index 9e93847ab5..dab79b74d3 100644
--- a/spec/resolver/basic_spec.rb
+++ b/spec/resolver/basic_spec.rb
@@ -9,31 +9,31 @@ RSpec.describe "Resolving" do
it "resolves a single gem" do
dep "rack"
- should_resolve_as %w(rack-1.1)
+ should_resolve_as %w[rack-1.1]
end
it "resolves a gem with dependencies" do
dep "actionpack"
- should_resolve_as %w(actionpack-2.3.5 activesupport-2.3.5 rack-1.0)
+ should_resolve_as %w[actionpack-2.3.5 activesupport-2.3.5 rack-1.0]
end
it "resolves a conflicting index" do
@index = a_conflict_index
dep "my_app"
- should_resolve_as %w(activemodel-3.2.11 builder-3.0.4 grape-0.2.6 my_app-1.0.0)
+ should_resolve_as %w[activemodel-3.2.11 builder-3.0.4 grape-0.2.6 my_app-1.0.0]
end
it "resolves a complex conflicting index" do
@index = a_complex_conflict_index
dep "my_app"
- should_resolve_as %w(a-1.4.0 b-0.3.5 c-3.2 d-0.9.8 my_app-1.1.0)
+ should_resolve_as %w[a-1.4.0 b-0.3.5 c-3.2 d-0.9.8 my_app-1.1.0]
end
it "resolves a index with conflict on child" do
@index = index_with_conflict_on_child
dep "chef_app"
- should_resolve_as %w(berkshelf-2.0.7 chef-10.26 chef_app-1.0.0 json-1.7.7)
+ should_resolve_as %w[berkshelf-2.0.7 chef-10.26 chef_app-1.0.0 json-1.7.7]
end
it "resolves a index with root level conflict on child" do
@@ -42,7 +42,7 @@ RSpec.describe "Resolving" do
dep "activesupport", "~> 3.0"
dep "activerecord", "~> 3.0"
dep "builder", "~> 2.1.2"
- should_resolve_as %w(activesupport-3.0.5 i18n-0.4.2 builder-2.1.2 activerecord-3.0.5 activemodel-3.0.5)
+ should_resolve_as %w[activesupport-3.0.5 i18n-0.4.2 builder-2.1.2 activerecord-3.0.5 activemodel-3.0.5]
end
it "raises an exception if a child dependency is not resolved" do
@@ -55,7 +55,7 @@ RSpec.describe "Resolving" do
it "raises an exception with the minimal set of conflicting dependencies" do
@index = build_index do
- %w(0.9 1.0 2.0).each {|v| gem("a", v) }
+ %w[0.9 1.0 2.0].each {|v| gem("a", v) }
gem("b", "1.0") { dep "a", ">= 2" }
gem("c", "1.0") { dep "a", "< 1" }
end
@@ -88,14 +88,14 @@ Bundler could not find compatible versions for gem "a":
it "should install the latest possible version of a direct requirement with no constraints given" do
@index = a_complicated_index
dep "foo"
- should_resolve_and_include %w(foo-3.0.5)
+ should_resolve_and_include %w[foo-3.0.5]
end
# Issue #3459
it "should install the latest possible version of a direct requirement with constraints given" do
@index = a_complicated_index
dep "foo", ">= 3.0.0"
- should_resolve_and_include %w(foo-3.0.5)
+ should_resolve_and_include %w[foo-3.0.5]
end
it "takes into account required_ruby_version" do
@@ -125,7 +125,7 @@ Bundler could not find compatible versions for gem "a":
deps << Bundler::DepProxy.new(d, "ruby")
end
- should_resolve_and_include %w(foo-1.0.0 bar-1.0.0), [{}, []]
+ should_resolve_and_include %w[foo-1.0.0 bar-1.0.0], [{}, []]
end
context "conservative" do
@@ -139,7 +139,7 @@ Bundler could not find compatible versions for gem "a":
gem("foo", "1.5.0") { dep "bar", "~> 2.1" }
gem("foo", "1.5.1") { dep "bar", "~> 3.0" }
gem("foo", "2.0.0") { dep "bar", "~> 3.0" }
- gem "bar", %w(2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0)
+ gem "bar", %w[2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0]
end
dep "foo"
@@ -147,23 +147,23 @@ Bundler could not find compatible versions for gem "a":
@base = Bundler::SpecSet.new([])
# locked represents versions in lockfile
- @locked = locked(%w(foo 1.4.3), %w(bar 2.0.3))
+ @locked = locked(%w[foo 1.4.3], %w[bar 2.0.3])
end
it "resolves all gems to latest patch" do
# strict is not set, so bar goes up a minor version due to dependency from foo 1.4.5
- should_conservative_resolve_and_include :patch, [], %w(foo-1.4.5 bar-2.1.1)
+ should_conservative_resolve_and_include :patch, [], %w[foo-1.4.5 bar-2.1.1]
end
it "resolves all gems to latest patch strict" do
# strict is set, so foo can only go up to 1.4.4 to avoid bar going up a minor version, and bar can go up to 2.0.5
- should_conservative_resolve_and_include [:patch, :strict], [], %w(foo-1.4.4 bar-2.0.5)
+ should_conservative_resolve_and_include [:patch, :strict], [], %w[foo-1.4.4 bar-2.0.5]
end
it "resolves foo only to latest patch - same dependency case" do
- @locked = locked(%w(foo 1.3.7), %w(bar 2.0.3))
+ @locked = locked(%w[foo 1.3.7], %w[bar 2.0.3])
# bar is locked, and the lock holds here because the dependency on bar doesn't change on the matching foo version.
- should_conservative_resolve_and_include :patch, ["foo"], %w(foo-1.3.8 bar-2.0.3)
+ should_conservative_resolve_and_include :patch, ["foo"], %w[foo-1.3.8 bar-2.0.3]
end
it "resolves foo only to latest patch - changing dependency not declared case" do
@@ -173,44 +173,44 @@ Bundler could not find compatible versions for gem "a":
# dependency of "bar", "~> 2.1" -- bar-2.1.1 -- is selected. This is not a bug and follows
# the long-standing documented Conservative Updating behavior of bundle install.
# http://bundler.io/v1.12/man/bundle-install.1.html#CONSERVATIVE-UPDATING
- should_conservative_resolve_and_include :patch, ["foo"], %w(foo-1.4.5 bar-2.1.1)
+ should_conservative_resolve_and_include :patch, ["foo"], %w[foo-1.4.5 bar-2.1.1]
end
it "resolves foo only to latest patch - changing dependency declared case" do
# bar is locked AND a declared dependency in the Gemfile, so it will not move, and therefore
# foo can only move up to 1.4.4.
@base << build_spec("bar", "2.0.3").first
- should_conservative_resolve_and_include :patch, ["foo"], %w(foo-1.4.4 bar-2.0.3)
+ should_conservative_resolve_and_include :patch, ["foo"], %w[foo-1.4.4 bar-2.0.3]
end
it "resolves foo only to latest patch strict" do
# adding strict helps solve the possibly unexpected behavior of bar changing in the prior test case,
# because no versions will be returned for bar ~> 2.1, so the engine falls back to ~> 2.0 (turn on
# debugging to see this happen).
- should_conservative_resolve_and_include [:patch, :strict], ["foo"], %w(foo-1.4.4 bar-2.0.3)
+ should_conservative_resolve_and_include [:patch, :strict], ["foo"], %w[foo-1.4.4 bar-2.0.3]
end
it "resolves bar only to latest patch" do
# bar is locked, so foo can only go up to 1.4.4
- should_conservative_resolve_and_include :patch, ["bar"], %w(foo-1.4.3 bar-2.0.5)
+ should_conservative_resolve_and_include :patch, ["bar"], %w[foo-1.4.3 bar-2.0.5]
end
it "resolves all gems to latest minor" do
# strict is not set, so bar goes up a major version due to dependency from foo 1.4.5
- should_conservative_resolve_and_include :minor, [], %w(foo-1.5.1 bar-3.0.0)
+ should_conservative_resolve_and_include :minor, [], %w[foo-1.5.1 bar-3.0.0]
end
it "resolves all gems to latest minor strict" do
# strict is set, so foo can only go up to 1.5.0 to avoid bar going up a major version
- should_conservative_resolve_and_include [:minor, :strict], [], %w(foo-1.5.0 bar-2.1.1)
+ should_conservative_resolve_and_include [:minor, :strict], [], %w[foo-1.5.0 bar-2.1.1]
end
it "resolves all gems to latest major" do
- should_conservative_resolve_and_include :major, [], %w(foo-2.0.0 bar-3.0.0)
+ should_conservative_resolve_and_include :major, [], %w[foo-2.0.0 bar-3.0.0]
end
it "resolves all gems to latest major strict" do
- should_conservative_resolve_and_include [:major, :strict], [], %w(foo-2.0.0 bar-3.0.0)
+ should_conservative_resolve_and_include [:major, :strict], [], %w[foo-2.0.0 bar-3.0.0]
end
# Why would this happen in real life? If bar 2.2 has a bug that the author of foo wants to bypass
@@ -221,7 +221,7 @@ Bundler could not find compatible versions for gem "a":
gem("foo", "1.4.3") { dep "bar", "~> 2.2" }
gem("foo", "1.4.4") { dep "bar", "~> 2.1.0" }
gem("foo", "1.5.0") { dep "bar", "~> 2.0.0" }
- gem "bar", %w(2.0.5 2.1.1 2.2.3)
+ gem "bar", %w[2.0.5 2.1.1 2.2.3]
end
dep "foo"
@@ -229,28 +229,28 @@ Bundler could not find compatible versions for gem "a":
@base = Bundler::SpecSet.new([])
# locked represents versions in lockfile
- @locked = locked(%w(foo 1.4.3), %w(bar 2.2.3))
+ @locked = locked(%w[foo 1.4.3], %w[bar 2.2.3])
end
it "could revert to a previous version level patch" do
- should_conservative_resolve_and_include :patch, [], %w(foo-1.4.4 bar-2.1.1)
+ should_conservative_resolve_and_include :patch, [], %w[foo-1.4.4 bar-2.1.1]
end
it "cannot revert to a previous version in strict mode level patch" do
# the strict option removes the version required to match, so a version conflict results
expect do
- should_conservative_resolve_and_include [:patch, :strict], [], %w(foo-1.4.3 bar-2.1.1)
+ should_conservative_resolve_and_include [:patch, :strict], [], %w[foo-1.4.3 bar-2.1.1]
end.to raise_error Bundler::VersionConflict, /#{Regexp.escape("Could not find gem 'bar (~> 2.1.0)'")}/
end
it "could revert to a previous version level minor" do
- should_conservative_resolve_and_include :minor, [], %w(foo-1.5.0 bar-2.0.5)
+ should_conservative_resolve_and_include :minor, [], %w[foo-1.5.0 bar-2.0.5]
end
it "cannot revert to a previous version in strict mode level minor" do
# the strict option removes the version required to match, so a version conflict results
expect do
- should_conservative_resolve_and_include [:minor, :strict], [], %w(foo-1.4.3 bar-2.1.1)
+ should_conservative_resolve_and_include [:minor, :strict], [], %w[foo-1.4.3 bar-2.1.1]
end.to raise_error Bundler::VersionConflict, /#{Regexp.escape("Could not find gem 'bar (~> 2.0.0)'")}/
end
end
diff --git a/spec/resolver/platform_spec.rb b/spec/resolver/platform_spec.rb
index 90d6f637ce..2028ba26dc 100644
--- a/spec/resolver/platform_spec.rb
+++ b/spec/resolver/platform_spec.rb
@@ -11,21 +11,21 @@ RSpec.describe "Resolving platform craziness" do
dep "nokogiri"
platforms "ruby", "java"
- should_resolve_as %w(nokogiri-1.4.2 nokogiri-1.4.2-java weakling-0.0.3)
+ should_resolve_as %w[nokogiri-1.4.2 nokogiri-1.4.2-java weakling-0.0.3]
end
it "doesn't pull gems that don't exist for the current platform" do
dep "nokogiri"
platforms "ruby"
- should_resolve_as %w(nokogiri-1.4.2)
+ should_resolve_as %w[nokogiri-1.4.2]
end
it "doesn't pull gems when the version is available for all requested platforms" do
dep "nokogiri"
platforms "mswin32"
- should_resolve_as %w(nokogiri-1.4.2.1-x86-mswin32)
+ should_resolve_as %w[nokogiri-1.4.2.1-x86-mswin32]
end
end
@@ -43,32 +43,32 @@ RSpec.describe "Resolving platform craziness" do
# win32 is hardcoded to get CPU x86 in rubygems
platforms "mswin32"
dep "thin"
- should_resolve_as %w(thin-1.2.7-x86-mswin32)
+ should_resolve_as %w[thin-1.2.7-x86-mswin32]
end
it "finds mingw gems" do
# mingw is _not_ hardcoded to add CPU x86 in rubygems
platforms "x86-mingw32"
dep "thin"
- should_resolve_as %w(thin-1.2.7-mingw32)
+ should_resolve_as %w[thin-1.2.7-mingw32]
end
it "finds x64-mingw gems" do
platforms "x64-mingw32"
dep "thin"
- should_resolve_as %w(thin-1.2.7-x64-mingw32)
+ should_resolve_as %w[thin-1.2.7-x64-mingw32]
end
it "finds universal-mingw gems on x86-mingw" do
platform "x86-mingw32"
dep "win32-api"
- should_resolve_as %w(win32-api-1.5.1-universal-mingw32)
+ should_resolve_as %w[win32-api-1.5.1-universal-mingw32]
end
it "finds universal-mingw gems on x64-mingw" do
platform "x64-mingw32"
dep "win32-api"
- should_resolve_as %w(win32-api-1.5.1-universal-mingw32)
+ should_resolve_as %w[win32-api-1.5.1-universal-mingw32]
end
end
@@ -87,7 +87,7 @@ RSpec.describe "Resolving platform craziness" do
dep "baz", " ~> 1.1.0"
end
- gem "baz", %w(1.0.0 1.1.0 1.2.0)
+ gem "baz", %w[1.0.0 1.1.0 1.2.0]
end
end