diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-07-14 22:20:40 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-07-20 09:35:41 -0500 |
commit | c476ee2672b506f7f8909cd44ba4111da4c2b5c2 (patch) | |
tree | be3480874093648d116e71976ef869bbebe63112 /spec | |
parent | af80780f713f8f798d67d1511c2817871c60f125 (diff) | |
download | bundler-c476ee2672b506f7f8909cd44ba4111da4c2b5c2.tar.gz |
[RuboCop] Update to 0.41.2
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/bundler_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/cli_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/endpoint_specification_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/fetcher/dependency_spec.rb | 9 | ||||
-rw-r--r-- | spec/bundler/gem_version_promoter_spec.rb | 30 | ||||
-rw-r--r-- | spec/bundler/settings_spec.rb | 3 | ||||
-rw-r--r-- | spec/bundler/shared_helpers_spec.rb | 15 | ||||
-rw-r--r-- | spec/bundler/uri_credentials_filter_spec.rb | 3 | ||||
-rw-r--r-- | spec/commands/binstubs_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 6 | ||||
-rw-r--r-- | spec/commands/help_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/install_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/compact_index_spec.rb | 3 | ||||
-rw-r--r-- | spec/install/gems/dependency_api_spec.rb | 6 | ||||
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 3 | ||||
-rw-r--r-- | spec/support/helpers.rb | 8 |
17 files changed, 66 insertions, 40 deletions
diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index 34f559e702..8708dc7c55 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -106,7 +106,7 @@ describe Bundler do describe "#which" do let(:executable) { "executable" } - let(:path) { %w(/a /b c ../d "/e") } + let(:path) { %w(/a /b c ../d /e) } let(:expected) { "executable" } before do diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index 2237ee9731..e04902488e 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -14,7 +14,7 @@ describe "bundle executable" do end it "looks for a binary and executes it if it's named bundler-<task>" do - File.open(tmp("bundler-testtasks"), "w", 0755) do |f| + File.open(tmp("bundler-testtasks"), "w", 0o755) do |f| f.puts "#!/usr/bin/env ruby\nputs 'Hello, world'\n" end diff --git a/spec/bundler/endpoint_specification_spec.rb b/spec/bundler/endpoint_specification_spec.rb index cdf81cd0f7..6718b24971 100644 --- a/spec/bundler/endpoint_specification_spec.rb +++ b/spec/bundler/endpoint_specification_spec.rb @@ -29,7 +29,8 @@ describe Bundler::EndpointSpecification do it "should raise the original error" do expect { subject.send(:build_dependency, name, [requirement1, requirement2]) }.to raise_error( - ArgumentError, "Some error occurred") + ArgumentError, "Some error occurred" + ) end end @@ -44,7 +45,8 @@ describe Bundler::EndpointSpecification do it "should raise a Bundler::GemspecError with invalid gemspec message" do expect { subject.send(:build_dependency, name, [requirement1, requirement2]) }.to raise_error( - Bundler::GemspecError, /Unfortunately, the gem foo \(1\.0\.0\) has an invalid gemspec/) + Bundler::GemspecError, /Unfortunately, the gem foo \(1\.0\.0\) has an invalid gemspec/ + ) end end end diff --git a/spec/bundler/fetcher/dependency_spec.rb b/spec/bundler/fetcher/dependency_spec.rb index b11bcdcd79..bf7749d07a 100644 --- a/spec/bundler/fetcher/dependency_spec.rb +++ b/spec/bundler/fetcher/dependency_spec.rb @@ -201,7 +201,8 @@ describe Bundler::Fetcher::Dependency do it "should log the query list at debug level" do expect(Bundler).to receive_message_chain(:ui, :debug).with( - "Query Gemcutter Dependency Endpoint API: foo,bar,bundler,rubocop") + "Query Gemcutter Dependency Endpoint API: foo,bar,bundler,rubocop" + ) subject.dependency_specs(gem_names) end @@ -267,7 +268,8 @@ describe Bundler::Fetcher::Dependency do it "should return an api calling uri with the gems in the query" do expect(subject.dependency_api_uri(gem_names).to_s).to eq( - "http://gem-api.com/api/v1/dependencies?gems=foo%2Cbar%2Cbundler%2Crubocop") + "http://gem-api.com/api/v1/dependencies?gems=foo%2Cbar%2Cbundler%2Crubocop" + ) end end @@ -278,7 +280,8 @@ describe Bundler::Fetcher::Dependency do it "should return an api calling uri with no query" do expect(subject.dependency_api_uri(gem_names).to_s).to eq( - "http://gem-api.com/api/v1/dependencies") + "http://gem-api.com/api/v1/dependencies" + ) end end end diff --git a/spec/bundler/gem_version_promoter_spec.rb b/spec/bundler/gem_version_promoter_spec.rb index 5cbc74bcd9..9e5a7bb581 100644 --- a/spec/bundler/gem_version_promoter_spec.rb +++ b/spec/bundler/gem_version_promoter_spec.rb @@ -45,7 +45,8 @@ describe Bundler::GemVersionPromoter do keep_locked(:level => :patch) res = @gvp.filter_dep_specs( build_spec_group("foo", %w(1.7.8 1.7.9 1.8.0)), - build_spec("foo", "1.7.8").first) + build_spec("foo", "1.7.8").first + ) expect(versions(res)).to eq %w(1.7.9 1.7.8) end @@ -53,7 +54,8 @@ describe Bundler::GemVersionPromoter do unlocking(:level => :patch) res = @gvp.filter_dep_specs( build_spec_group("foo", %w(1.7.8 1.7.9 1.8.0)), - build_spec("foo", "1.7.8").first) + build_spec("foo", "1.7.8").first + ) expect(versions(res)).to eq %w(1.7.8 1.7.9) end @@ -61,7 +63,8 @@ describe Bundler::GemVersionPromoter do unlocking(:level => :patch) res = @gvp.filter_dep_specs( build_spec_group("foo", %w(1.7.9 1.8.0 2.0.0)), - build_spec("foo", "1.7.9").first) + build_spec("foo", "1.7.9").first + ) expect(versions(res)).to eq %w(1.7.9) end end @@ -71,7 +74,8 @@ describe Bundler::GemVersionPromoter do unlocking(:level => :minor) res = @gvp.filter_dep_specs( build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)), - build_spec("foo", "0.2.0").first) + build_spec("foo", "0.2.0").first + ) expect(versions(res)).to eq %w(0.2.0 0.3.0 0.3.1 0.9.0) end @@ -79,7 +83,8 @@ describe Bundler::GemVersionPromoter do keep_locked(:level => :minor) res = @gvp.filter_dep_specs( build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)), - build_spec("foo", "0.2.0").first) + build_spec("foo", "0.2.0").first + ) expect(versions(res)).to eq %w(0.3.0 0.3.1 0.9.0 0.2.0) end end @@ -89,7 +94,8 @@ describe Bundler::GemVersionPromoter do keep_locked(:level => :patch) res = @gvp.sort_dep_specs( build_spec_group("foo", %w(1.5.4 1.6.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 2.0.0 2.0.1)), - build_spec("foo", "1.7.7").first) + build_spec("foo", "1.7.7").first + ) expect(versions(res)).to eq %w(1.5.4 1.6.5 1.7.6 2.0.0 2.0.1 1.8.0 1.8.1 1.7.8 1.7.9 1.7.7) end @@ -97,7 +103,8 @@ describe Bundler::GemVersionPromoter do unlocking(:level => :patch) res = @gvp.sort_dep_specs( build_spec_group("foo", %w(1.7.7 1.7.8 1.7.9 1.8.0)), - build_spec("foo", "1.7.8").first) + build_spec("foo", "1.7.8").first + ) expect(versions(res)).to eq %w(1.7.7 1.8.0 1.7.8 1.7.9) end @@ -105,7 +112,8 @@ describe Bundler::GemVersionPromoter do unlocking(:level => :patch) res = @gvp.sort_dep_specs( build_spec_group("foo", %w(1.7.7 1.7.8 1.7.9 1.7.15 1.8.0)), - build_spec("foo", "1.7.8").first) + build_spec("foo", "1.7.8").first + ) expect(versions(res)).to eq %w(1.7.7 1.8.0 1.7.8 1.7.9 1.7.15) end @@ -113,7 +121,8 @@ describe Bundler::GemVersionPromoter do unlocking(:level => :patch) res = @gvp.sort_dep_specs( build_spec_group("foo", %w(1.7.9 1.8.0 2.0.0)), - build_spec("foo", "1.7.9").first) + build_spec("foo", "1.7.9").first + ) expect(versions(res)).to eq %w(2.0.0 1.8.0 1.7.9) end end @@ -123,7 +132,8 @@ describe Bundler::GemVersionPromoter do unlocking(:level => :minor) res = @gvp.sort_dep_specs( build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)), - build_spec("foo", "0.2.0").first) + build_spec("foo", "0.2.0").first + ) expect(versions(res)).to eq %w(2.0.0 2.0.1 1.0.0 0.2.0 0.3.0 0.3.1 0.9.0) end end diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb index a4ac02c0fb..0f7d2a0138 100644 --- a/spec/bundler/settings_spec.rb +++ b/spec/bundler/settings_spec.rb @@ -204,7 +204,8 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow it "reads older keys without trailing slashes" do settings["mirror.https://rubygems.org"] = "http://rubygems-mirror.org" expect(settings.mirror_for("https://rubygems.org/")).to eq( - URI("http://rubygems-mirror.org/")) + URI("http://rubygems-mirror.org/") + ) end end diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb index 2ad0c98dba..f617d5cfe5 100644 --- a/spec/bundler/shared_helpers_spec.rb +++ b/spec/bundler/shared_helpers_spec.rb @@ -27,7 +27,8 @@ describe Bundler::SharedHelpers do it "raises a GemfileNotFound error" do expect { subject.default_gemfile }.to raise_error( - Bundler::GemfileNotFound, "Could not locate Gemfile") + Bundler::GemfileNotFound, "Could not locate Gemfile" + ) end end end @@ -348,7 +349,8 @@ describe Bundler::SharedHelpers do it "raises a PermissionError" do expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error( - Bundler::PermissionError) + Bundler::PermissionError + ) end end @@ -357,7 +359,8 @@ describe Bundler::SharedHelpers do it "raises a TemporaryResourceError" do expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error( - Bundler::TemporaryResourceError) + Bundler::TemporaryResourceError + ) end end @@ -366,7 +369,8 @@ describe Bundler::SharedHelpers do it "raises a VirtualProtocolError" do expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error( - Bundler::VirtualProtocolError) + Bundler::VirtualProtocolError + ) end end @@ -375,7 +379,8 @@ describe Bundler::SharedHelpers do it "raises a OperationNotSupportedError" do expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error( - Bundler::OperationNotSupportedError) + Bundler::OperationNotSupportedError + ) end end end diff --git a/spec/bundler/uri_credentials_filter_spec.rb b/spec/bundler/uri_credentials_filter_spec.rb index b890c0ce5f..70f71cecac 100644 --- a/spec/bundler/uri_credentials_filter_spec.rb +++ b/spec/bundler/uri_credentials_filter_spec.rb @@ -98,7 +98,8 @@ describe Bundler::URICredentialsFilter do it "returns the string without the sensitive credentials" do expect(subject.credential_filtered_string(str_to_filter, uri)).to eq( - "This is a git message containing a uri https://x-oauth-basic@github.com/company/private-repo!") + "This is a git message containing a uri https://x-oauth-basic@github.com/company/private-repo!" + ) end end diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index c400d7ecae..e739f94248 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -93,7 +93,7 @@ describe "bundle binstubs <gem>" do end it "sets correct permissions for binstubs" do - with_umask(0002) do + with_umask(0o002) do install_gemfile <<-G source "file://#{gem_repo1}" gem "rack" diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 67d70b511c..72d422c3a2 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -460,7 +460,7 @@ describe "bundle clean" do describe "when missing permissions" do after do - FileUtils.chmod(0755, default_bundle_path("cache")) + FileUtils.chmod(0o755, default_bundle_path("cache")) end it "returns a helpful error message" do gemfile <<-G @@ -479,7 +479,7 @@ describe "bundle clean" do bundle :install system_cache_path = default_bundle_path("cache") - FileUtils.chmod(0500, system_cache_path) + FileUtils.chmod(0o500, system_cache_path) bundle :clean, :force => true diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index cf10521fac..5e16eea882 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -102,7 +102,7 @@ describe "bundle exec" do f.puts "#!/bin/sh" f.puts "echo foobar" end - File.chmod(0744, "--verbose") + File.chmod(0o744, "--verbose") with_path_as(".") do bundle "exec -- --verbose" end @@ -232,7 +232,7 @@ describe "bundle exec" do #!/usr/bin/env ruby puts "args: #{ARGV.inspect}" RUBY - bundled_app("print_args").chmod(0755) + bundled_app("print_args").chmod(0o755) end it "shows executable's man page when --help is after the executable" do @@ -466,7 +466,7 @@ describe "bundle exec" do before do path.open("w") {|f| f << executable } - path.chmod(0755) + path.chmod(0o755) install_gemfile <<-G gem "rack" diff --git a/spec/commands/help_spec.rb b/spec/commands/help_spec.rb index 4e35ba3e6a..ef928080ef 100644 --- a/spec/commands/help_spec.rb +++ b/spec/commands/help_spec.rb @@ -39,7 +39,7 @@ describe "bundle help" do end it "looks for a binary and executes it with --help option if it's named bundler-<task>" do - File.open(tmp("bundler-testtasks"), "w", 0755) do |f| + File.open(tmp("bundler-testtasks"), "w", 0o755) do |f| f.puts "#!/usr/bin/env ruby\nputs ARGV.join(' ')\n" end diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index 524071d989..ea2c3c0078 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -462,7 +462,7 @@ describe "bundle install with gem sources" do end it "should display a proper message to explain the problem" do - FileUtils.chmod(0500, bundled_app("vendor")) + FileUtils.chmod(0o500, bundled_app("vendor")) bundle :install, :path => "vendor" expect(out).to include(bundled_app("vendor").to_s) diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb index e96936f01d..22557156aa 100644 --- a/spec/install/gems/compact_index_spec.rb +++ b/spec/install/gems/compact_index_spec.rb @@ -40,7 +40,8 @@ describe "compact index api" do "activerecord 2.3.2", "actionmailer 2.3.2", "activeresource 2.3.2", - "activesupport 2.3.2") + "activesupport 2.3.2" + ) end it "should handle multiple gem dependencies on the same gem" do diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index 70190dd01b..837a1f872c 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -40,7 +40,8 @@ describe "gemcutter's dependency API" do "activerecord 2.3.2", "actionmailer 2.3.2", "activeresource 2.3.2", - "activesupport 2.3.2") + "activesupport 2.3.2" + ) end it "should handle multiple gem dependencies on the same gem" do @@ -150,7 +151,8 @@ describe "gemcutter's dependency API" do "activesupport 2.3.2", "thin 1.0.0", "rack 1.0.0", - "rails 2.3.2") + "rails 2.3.2" + ) end it "falls back when Gemcutter API doesn't return proper Marshal format" do diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index c2d1cdbeb5..e706d71098 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -107,7 +107,8 @@ describe "major deprecations" do G expect(warnings).to have_major_deprecation a_string_including( - "flags passed to commands will no longer be automatically remembered.") + "flags passed to commands will no longer be automatically remembered." + ) end end end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 2c3a8f7254..a609385984 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -264,7 +264,7 @@ module Spec def break_git! FileUtils.mkdir_p(tmp("broken_path")) - File.open(tmp("broken_path/git"), "w", 0755) do |f| + File.open(tmp("broken_path/git"), "w", 0o755) do |f| f.puts "#!/usr/bin/env ruby\nSTDERR.puts 'This is not the git you are looking for'\nexit 1" end @@ -273,7 +273,7 @@ module Spec def with_fake_man FileUtils.mkdir_p(tmp("fake_man")) - File.open(tmp("fake_man/man"), "w", 0755) do |f| + File.open(tmp("fake_man/man"), "w", 0o755) do |f| f.puts "#!/usr/bin/env ruby\nputs ARGV.inspect\n" end with_path_added(tmp("fake_man")) { yield } @@ -411,10 +411,10 @@ module Spec end end - Dir[pattern].each(&chmod[0555, 0444]) + Dir[pattern].each(&chmod[0o555, 0o444]) yield ensure - Dir[pattern].each(&chmod[0755, 0644]) + Dir[pattern].each(&chmod[0o755, 0o644]) end def process_file(pathname) |