diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-05-06 18:06:21 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-03 09:29:55 +0900 |
commit | c3ddd47ce7b546530e2241b0ea6a96817977886a (patch) | |
tree | 46515c479773d7add25773b536009e096ee9fa78 /spec/bundler/plugins | |
parent | d8d5e16305ee071f7cf16980788cabcc44799c2e (diff) | |
download | ruby-c3ddd47ce7b546530e2241b0ea6a96817977886a.tar.gz |
[bundler/bundler] Normalize file:// handling in specs
https://github.com/bundler/bundler/commit/5946d62ad0
Diffstat (limited to 'spec/bundler/plugins')
-rw-r--r-- | spec/bundler/plugins/command_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/plugins/hook_spec.rb | 16 | ||||
-rw-r--r-- | spec/bundler/plugins/install_spec.rb | 38 | ||||
-rw-r--r-- | spec/bundler/plugins/list_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/plugins/source/example_spec.rb | 32 | ||||
-rw-r--r-- | spec/bundler/plugins/source_spec.rb | 16 |
6 files changed, 56 insertions, 56 deletions
diff --git a/spec/bundler/plugins/command_spec.rb b/spec/bundler/plugins/command_spec.rb index 53d34f7acc..4728f66f5f 100644 --- a/spec/bundler/plugins/command_spec.rb +++ b/spec/bundler/plugins/command_spec.rb @@ -18,7 +18,7 @@ RSpec.describe "command plugins" do end end - bundle "plugin install command-mah --source file://#{gem_repo2}" + bundle "plugin install command-mah --source #{file_uri_for(gem_repo2)}" end it "executes without arguments" do @@ -46,7 +46,7 @@ RSpec.describe "command plugins" do end end - bundle "plugin install the-echoer --source file://#{gem_repo2}" + bundle "plugin install the-echoer --source #{file_uri_for(gem_repo2)}" expect(out).to include("Installed plugin the-echoer") bundle "echo tacos tofu lasange" @@ -69,7 +69,7 @@ RSpec.describe "command plugins" do end end - bundle "plugin install copycat --source file://#{gem_repo2}" + bundle "plugin install copycat --source #{file_uri_for(gem_repo2)}" expect(out).not_to include("Installed plugin copycat") diff --git a/spec/bundler/plugins/hook_spec.rb b/spec/bundler/plugins/hook_spec.rb index 53062095e2..72feb14d84 100644 --- a/spec/bundler/plugins/hook_spec.rb +++ b/spec/bundler/plugins/hook_spec.rb @@ -13,12 +13,12 @@ RSpec.describe "hook plugins" do end end - bundle "plugin install before-install-all-plugin --source file://#{gem_repo2}" + bundle "plugin install before-install-all-plugin --source #{file_uri_for(gem_repo2)}" end it "runs before all rubygems are installed" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rake" gem "rack" G @@ -39,12 +39,12 @@ RSpec.describe "hook plugins" do end end - bundle "plugin install before-install-plugin --source file://#{gem_repo2}" + bundle "plugin install before-install-plugin --source #{file_uri_for(gem_repo2)}" end it "runs before each rubygem is installed" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rake" gem "rack" G @@ -66,12 +66,12 @@ RSpec.describe "hook plugins" do end end - bundle "plugin install after-install-all-plugin --source file://#{gem_repo2}" + bundle "plugin install after-install-all-plugin --source #{file_uri_for(gem_repo2)}" end it "runs after each rubygem is installed" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rake" gem "rack" G @@ -92,12 +92,12 @@ RSpec.describe "hook plugins" do end end - bundle "plugin install after-install-plugin --source file://#{gem_repo2}" + bundle "plugin install after-install-plugin --source #{file_uri_for(gem_repo2)}" end it "runs after each rubygem is installed" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rake" gem "rack" G diff --git a/spec/bundler/plugins/install_spec.rb b/spec/bundler/plugins/install_spec.rb index afc6087c1b..669ed09fb5 100644 --- a/spec/bundler/plugins/install_spec.rb +++ b/spec/bundler/plugins/install_spec.rb @@ -9,14 +9,14 @@ RSpec.describe "bundler plugin install" do end it "shows proper message when gem in not found in the source" do - bundle "plugin install no-foo --source file://#{gem_repo1}" + bundle "plugin install no-foo --source #{file_uri_for(gem_repo1)}" expect(err).to include("Could not find") plugin_should_not_be_installed("no-foo") end it "installs from rubygems source" do - bundle "plugin install foo --source file://#{gem_repo2}" + bundle "plugin install foo --source #{file_uri_for(gem_repo2)}" expect(out).to include("Installed plugin foo") plugin_should_be_installed("foo") @@ -24,18 +24,18 @@ RSpec.describe "bundler plugin install" do context "plugin is already installed" do before do - bundle "plugin install foo --source file://#{gem_repo2}" + bundle "plugin install foo --source #{file_uri_for(gem_repo2)}" end it "doesn't install plugin again" do - bundle "plugin install foo --source file://#{gem_repo2}" + bundle "plugin install foo --source #{file_uri_for(gem_repo2)}" expect(out).not_to include("Installing plugin foo") expect(out).not_to include("Installed plugin foo") end end it "installs multiple plugins" do - bundle "plugin install foo kung-foo --source file://#{gem_repo2}" + bundle "plugin install foo kung-foo --source #{file_uri_for(gem_repo2)}" expect(out).to include("Installed plugin foo") expect(out).to include("Installed plugin kung-foo") @@ -49,7 +49,7 @@ RSpec.describe "bundler plugin install" do build_plugin "kung-foo", "1.1" end - bundle "plugin install foo kung-foo --version '1.0' --source file://#{gem_repo2}" + bundle "plugin install foo kung-foo --version '1.0' --source #{file_uri_for(gem_repo2)}" expect(out).to include("Installing foo 1.0") expect(out).to include("Installing kung-foo 1.0") @@ -73,7 +73,7 @@ RSpec.describe "bundler plugin install" do s.write("src/fubar.rb") end end - bundle "plugin install testing --source file://#{gem_repo2}" + bundle "plugin install testing --source #{file_uri_for(gem_repo2)}" bundle "check2", "no-color" => false expect(out).to eq("mate") @@ -86,7 +86,7 @@ RSpec.describe "bundler plugin install" do build_plugin "kung-foo", "1.1" end - bundle "plugin install foo kung-foo --version '1.0' --source file://#{gem_repo2}" + bundle "plugin install foo kung-foo --version '1.0' --source #{file_uri_for(gem_repo2)}" expect(out).to include("Installing foo 1.0") expect(out).to include("Installing kung-foo 1.0") @@ -96,7 +96,7 @@ RSpec.describe "bundler plugin install" do build_gem "charlie" end - bundle "plugin install charlie --source file://#{gem_repo2}" + bundle "plugin install charlie --source #{file_uri_for(gem_repo2)}" expect(err).to include("plugins.rb was not found") @@ -115,7 +115,7 @@ RSpec.describe "bundler plugin install" do end end - bundle "plugin install chaplin --source file://#{gem_repo2}" + bundle "plugin install chaplin --source #{file_uri_for(gem_repo2)}" expect(global_plugin_gem("chaplin-1.0")).not_to be_directory @@ -129,7 +129,7 @@ RSpec.describe "bundler plugin install" do s.write "plugins.rb" end - bundle "plugin install foo --git file://#{lib_path("foo-1.0")}" + bundle "plugin install foo --git #{file_uri_for(lib_path("foo-1.0"))}" expect(out).to include("Installed plugin foo") plugin_should_be_installed("foo") @@ -157,7 +157,7 @@ RSpec.describe "bundler plugin install" do context "Gemfile eval" do it "installs plugins listed in gemfile" do gemfile <<-G - source 'file://#{gem_repo2}' + source '#{file_uri_for(gem_repo2)}' plugin 'foo' gem 'rack', "1.0.0" G @@ -178,7 +178,7 @@ RSpec.describe "bundler plugin install" do end gemfile <<-G - source 'file://#{gem_repo2}' + source '#{file_uri_for(gem_repo2)}' plugin 'foo', "1.0" G @@ -207,12 +207,12 @@ RSpec.describe "bundler plugin install" do context "in deployment mode" do it "installs plugins" do install_gemfile! <<-G - source 'file://#{gem_repo2}' + source '#{file_uri_for(gem_repo2)}' gem 'rack', "1.0.0" G install_gemfile! <<-G, forgotten_command_line_options(:deployment => true) - source 'file://#{gem_repo2}' + source '#{file_uri_for(gem_repo2)}' plugin 'foo' gem 'rack', "1.0.0" G @@ -233,7 +233,7 @@ RSpec.describe "bundler plugin install" do require "bundler/inline" gemfile do - source 'file://#{gem_repo2}' + source '#{file_uri_for(gem_repo2)}' plugin 'foo' end RUBY @@ -246,7 +246,7 @@ RSpec.describe "bundler plugin install" do describe "local plugin" do it "is installed when inside an app" do gemfile "" - bundle "plugin install foo --source file://#{gem_repo2}" + bundle "plugin install foo --source #{file_uri_for(gem_repo2)}" plugin_should_be_installed("foo") expect(local_plugin_gem("foo-1.0")).to be_directory @@ -269,7 +269,7 @@ RSpec.describe "bundler plugin install" do end # inside the app - gemfile "source 'file://#{gem_repo2}'\nplugin 'fubar'" + gemfile "source '#{file_uri_for(gem_repo2)}'\nplugin 'fubar'" bundle "install" update_repo2 do @@ -288,7 +288,7 @@ RSpec.describe "bundler plugin install" do # outside the app Dir.chdir tmp - bundle "plugin install fubar --source file://#{gem_repo2}" + bundle "plugin install fubar --source #{file_uri_for(gem_repo2)}" end it "inside the app takes precedence over global plugin" do diff --git a/spec/bundler/plugins/list_spec.rb b/spec/bundler/plugins/list_spec.rb index 7dc9d10c4b..4a686415ad 100644 --- a/spec/bundler/plugins/list_spec.rb +++ b/spec/bundler/plugins/list_spec.rb @@ -38,7 +38,7 @@ RSpec.describe "bundler plugin list" do context "single plugin installed" do it "shows plugin name with commands list" do - bundle "plugin install foo --source file://#{gem_repo2}" + bundle "plugin install foo --source #{file_uri_for(gem_repo2)}" plugin_should_be_installed("foo") bundle "plugin list" @@ -49,7 +49,7 @@ RSpec.describe "bundler plugin list" do context "multiple plugins installed" do it "shows plugin names with commands list" do - bundle "plugin install foo bar --source file://#{gem_repo2}" + bundle "plugin install foo bar --source #{file_uri_for(gem_repo2)}" plugin_should_be_installed("foo", "bar") bundle "plugin list" diff --git a/spec/bundler/plugins/source/example_spec.rb b/spec/bundler/plugins/source/example_spec.rb index bc076c06bf..93b61b850a 100644 --- a/spec/bundler/plugins/source/example_spec.rb +++ b/spec/bundler/plugins/source/example_spec.rb @@ -52,7 +52,7 @@ RSpec.describe "real source plugins" do build_lib "a-path-gem" gemfile <<-G - source "file://localhost#{gem_repo2}" # plugin source + source "#{file_uri_for(gem_repo2)}" # plugin source source "#{lib_path("a-path-gem-1.0")}", :type => :mpath do gem "a-path-gem" end @@ -78,7 +78,7 @@ RSpec.describe "real source plugins" do a-path-gem (1.0) GEM - remote: file://localhost#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: PLATFORMS @@ -103,7 +103,7 @@ RSpec.describe "real source plugins" do a-path-gem (1.0) GEM - remote: file://localhost#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: PLATFORMS @@ -131,7 +131,7 @@ RSpec.describe "real source plugins" do end install_gemfile <<-G - source "file://#{gem_repo2}" # plugin source + source "#{file_uri_for(gem_repo2)}" # plugin source source "#{lib_path("gem-with-bin-1.0")}", :type => :mpath do gem "gem-with-bin" end @@ -186,7 +186,7 @@ RSpec.describe "real source plugins" do a-path-gem (1.0) GEM - remote: file:#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: PLATFORMS @@ -346,8 +346,8 @@ RSpec.describe "real source plugins" do build_git "ma-gitp-gem" gemfile <<-G - source "file://localhost#{gem_repo2}" # plugin source - source "file://#{lib_path("ma-gitp-gem-1.0")}", :type => :gitp do + source "#{file_uri_for(gem_repo2)}" # plugin source + source "#{file_uri_for(lib_path("ma-gitp-gem-1.0"))}", :type => :gitp do gem "ma-gitp-gem" end G @@ -365,14 +365,14 @@ RSpec.describe "real source plugins" do lockfile_should_be <<-G PLUGIN SOURCE - remote: file://#{lib_path("ma-gitp-gem-1.0")} + remote: #{file_uri_for(lib_path("ma-gitp-gem-1.0"))} type: gitp revision: #{revision} specs: ma-gitp-gem (1.0) GEM - remote: file://localhost#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: PLATFORMS @@ -392,14 +392,14 @@ RSpec.describe "real source plugins" do lockfile_should_be <<-G PLUGIN SOURCE - remote: file://#{lib_path("ma-gitp-gem-1.0")} + remote: #{file_uri_for(lib_path("ma-gitp-gem-1.0"))} type: gitp revision: #{revision} specs: ma-gitp-gem (1.0) GEM - remote: file://localhost#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: PLATFORMS @@ -418,14 +418,14 @@ RSpec.describe "real source plugins" do revision = revision_for(lib_path("ma-gitp-gem-1.0")) lockfile <<-G PLUGIN SOURCE - remote: file://#{lib_path("ma-gitp-gem-1.0")} + remote: #{file_uri_for(lib_path("ma-gitp-gem-1.0"))} type: gitp revision: #{revision} specs: ma-gitp-gem (1.0) GEM - remote: file:#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: PLATFORMS @@ -469,8 +469,8 @@ RSpec.describe "real source plugins" do it "updates the deps on change in gemfile" do update_git "ma-gitp-gem", "1.1", :path => lib_path("ma-gitp-gem-1.0"), :gemspec => true gemfile <<-G - source "file://#{gem_repo2}" # plugin source - source "file://#{lib_path("ma-gitp-gem-1.0")}", :type => :gitp do + source "#{file_uri_for(gem_repo2)}" # plugin source + source "#{file_uri_for(lib_path("ma-gitp-gem-1.0"))}", :type => :gitp do gem "ma-gitp-gem", "1.1" end G @@ -486,7 +486,7 @@ RSpec.describe "real source plugins" do ref = git.ref_for("master", 11) install_gemfile <<-G - source "file://#{gem_repo2}" # plugin source + source "#{file_uri_for(gem_repo2)}" # plugin source source '#{lib_path("foo-1.0")}', :type => :gitp do gem "foo" end diff --git a/spec/bundler/plugins/source_spec.rb b/spec/bundler/plugins/source_spec.rb index 543e90eb60..c8deee96b1 100644 --- a/spec/bundler/plugins/source_spec.rb +++ b/spec/bundler/plugins/source_spec.rb @@ -16,8 +16,8 @@ RSpec.describe "bundler source plugin" do it "installs bundler-source-* gem when no handler for source is present" do install_gemfile <<-G - source "file://#{gem_repo2}" - source "file://#{lib_path("gitp")}", :type => :psource do + source "#{file_uri_for(gem_repo2)}" + source "#{file_uri_for(lib_path("gitp"))}", :type => :psource do end G @@ -37,8 +37,8 @@ RSpec.describe "bundler source plugin" do end install_gemfile <<-G - source "file://#{gem_repo2}" - source "file://#{lib_path("gitp")}", :type => :psource do + source "#{file_uri_for(gem_repo2)}" + source "#{file_uri_for(lib_path("gitp"))}", :type => :psource do end G @@ -61,11 +61,11 @@ RSpec.describe "bundler source plugin" do context "explicit presence in gemfile" do before do install_gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" plugin "another-psource" - source "file://#{lib_path("gitp")}", :type => :psource do + source "#{file_uri_for(lib_path("gitp"))}", :type => :psource do end G end @@ -86,11 +86,11 @@ RSpec.describe "bundler source plugin" do context "explicit default source" do before do install_gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" plugin "bundler-source-psource" - source "file://#{lib_path("gitp")}", :type => :psource do + source "#{file_uri_for(lib_path("gitp"))}", :type => :psource do end G end |