diff options
Diffstat (limited to 'spec/bundler/bundler/plugin')
-rw-r--r-- | spec/bundler/bundler/plugin/api/source_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/bundler/plugin/dsl_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/bundler/plugin/index_spec.rb | 12 | ||||
-rw-r--r-- | spec/bundler/bundler/plugin/installer_spec.rb | 23 |
4 files changed, 22 insertions, 23 deletions
diff --git a/spec/bundler/bundler/plugin/api/source_spec.rb b/spec/bundler/bundler/plugin/api/source_spec.rb index 428ceb220a..ae02e08bea 100644 --- a/spec/bundler/bundler/plugin/api/source_spec.rb +++ b/spec/bundler/bundler/plugin/api/source_spec.rb @@ -51,7 +51,7 @@ RSpec.describe Bundler::Plugin::API::Source do context "to_lock" do it "returns the string with remote and type" do - expected = strip_whitespace <<-L + expected = <<~L PLUGIN SOURCE remote: #{uri} type: #{type} @@ -67,7 +67,7 @@ RSpec.describe Bundler::Plugin::API::Source do end it "includes them" do - expected = strip_whitespace <<-L + expected = <<~L PLUGIN SOURCE remote: #{uri} type: #{type} diff --git a/spec/bundler/bundler/plugin/dsl_spec.rb b/spec/bundler/bundler/plugin/dsl_spec.rb index 00e39dca69..235a549735 100644 --- a/spec/bundler/bundler/plugin/dsl_spec.rb +++ b/spec/bundler/bundler/plugin/dsl_spec.rb @@ -23,7 +23,7 @@ RSpec.describe Bundler::Plugin::DSL do it "adds #source with :type to list and also inferred_plugins list" do expect(dsl).to receive(:plugin).with("bundler-source-news").once - dsl.source("some_random_url", :type => "news") {} + dsl.source("some_random_url", type: "news") {} expect(dsl.inferred_plugins).to eq(["bundler-source-news"]) end @@ -31,8 +31,8 @@ RSpec.describe Bundler::Plugin::DSL do it "registers a source type plugin only once for multiple declarations" do expect(dsl).to receive(:plugin).with("bundler-source-news").and_call_original.once - dsl.source("some_random_url", :type => "news") {} - dsl.source("another_random_url", :type => "news") {} + dsl.source("some_random_url", type: "news") {} + dsl.source("another_random_url", type: "news") {} end end end diff --git a/spec/bundler/bundler/plugin/index_spec.rb b/spec/bundler/bundler/plugin/index_spec.rb index bf32c3e2ba..5a7047459f 100644 --- a/spec/bundler/bundler/plugin/index_spec.rb +++ b/spec/bundler/bundler/plugin/index_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Bundler::Plugin::Index do before do allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) - gemfile "" + gemfile "source \"#{file_uri_for(gem_repo1)}\"" path = lib_path(plugin_name) index.register_plugin("new-plugin", path.to_s, [path.join("lib").to_s], commands, sources, hooks) end @@ -140,7 +140,7 @@ RSpec.describe Bundler::Plugin::Index do describe "after conflict" do let(:commands) { ["foo"] } let(:sources) { ["bar"] } - let(:hooks) { ["hoook"] } + let(:hooks) { ["thehook"] } shared_examples "it cleans up" do it "the path" do @@ -156,7 +156,7 @@ RSpec.describe Bundler::Plugin::Index do end it "the hook" do - expect(index.hook_plugins("xhoook")).to be_empty + expect(index.hook_plugins("xthehook")).to be_empty end end @@ -164,7 +164,7 @@ RSpec.describe Bundler::Plugin::Index do before do expect do path = lib_path("cplugin") - index.register_plugin("cplugin", path.to_s, [path.join("lib").to_s], ["foo"], ["xbar"], ["xhoook"]) + index.register_plugin("cplugin", path.to_s, [path.join("lib").to_s], ["foo"], ["xbar"], ["xthehook"]) end.to raise_error(Index::CommandConflict) end @@ -175,7 +175,7 @@ RSpec.describe Bundler::Plugin::Index do before do expect do path = lib_path("cplugin") - index.register_plugin("cplugin", path.to_s, [path.join("lib").to_s], ["xfoo"], ["bar"], ["xhoook"]) + index.register_plugin("cplugin", path.to_s, [path.join("lib").to_s], ["xfoo"], ["bar"], ["xthehook"]) end.to raise_error(Index::SourceConflict) end @@ -186,7 +186,7 @@ RSpec.describe Bundler::Plugin::Index do before do expect do path = lib_path("cplugin") - index.register_plugin("cplugin", path.to_s, [path.join("lib").to_s], ["foo"], ["bar"], ["xhoook"]) + index.register_plugin("cplugin", path.to_s, [path.join("lib").to_s], ["foo"], ["bar"], ["xthehook"]) end.to raise_error(Index::CommandConflict) end diff --git a/spec/bundler/bundler/plugin/installer_spec.rb b/spec/bundler/bundler/plugin/installer_spec.rb index e89720f6f7..ed40029f5a 100644 --- a/spec/bundler/bundler/plugin/installer_spec.rb +++ b/spec/bundler/bundler/plugin/installer_spec.rb @@ -6,8 +6,7 @@ RSpec.describe Bundler::Plugin::Installer do describe "cli install" do it "uses Gem.sources when non of the source is provided" do sources = double(:sources) - Bundler.settings # initialize it before we have to touch rubygems.ext_lock - allow(Bundler).to receive_message_chain("rubygems.sources") { sources } + allow(Gem).to receive(:sources) { sources } allow(installer).to receive(:install_rubygems). with("new-plugin", [">= 0"], sources).once @@ -21,15 +20,15 @@ RSpec.describe Bundler::Plugin::Installer do allow(installer).to receive(:install_git). and_return("new-plugin" => spec) - expect(installer.install(["new-plugin"], :git => "https://some.ran/dom")). + expect(installer.install(["new-plugin"], git: "https://some.ran/dom")). to eq("new-plugin" => spec) end it "returns the installed spec after installing local git plugins" do - allow(installer).to receive(:install_local_git). + allow(installer).to receive(:install_git). and_return("new-plugin" => spec) - expect(installer.install(["new-plugin"], :local_git => "/phony/path/repo")). + expect(installer.install(["new-plugin"], git: "/phony/path/repo")). to eq("new-plugin" => spec) end @@ -37,7 +36,7 @@ RSpec.describe Bundler::Plugin::Installer do allow(installer).to receive(:install_rubygems). and_return("new-plugin" => spec) - expect(installer.install(["new-plugin"], :source => "https://some.ran/dom")). + expect(installer.install(["new-plugin"], source: "https://some.ran/dom")). to eq("new-plugin" => spec) end end @@ -52,13 +51,13 @@ RSpec.describe Bundler::Plugin::Installer do context "git plugins" do before do - build_git "ga-plugin", :path => lib_path("ga-plugin") do |s| + build_git "ga-plugin", path: lib_path("ga-plugin") do |s| s.write "plugins.rb" end end let(:result) do - installer.install(["ga-plugin"], :git => file_uri_for(lib_path("ga-plugin"))) + installer.install(["ga-plugin"], git: file_uri_for(lib_path("ga-plugin"))) end it "returns the installed spec after installing" do @@ -75,13 +74,13 @@ RSpec.describe Bundler::Plugin::Installer do context "local git plugins" do before do - build_git "ga-plugin", :path => lib_path("ga-plugin") do |s| + build_git "ga-plugin", path: lib_path("ga-plugin") do |s| s.write "plugins.rb" end end let(:result) do - installer.install(["ga-plugin"], :local_git => lib_path("ga-plugin").to_s) + installer.install(["ga-plugin"], git: lib_path("ga-plugin").to_s) end it "returns the installed spec after installing" do @@ -98,7 +97,7 @@ RSpec.describe Bundler::Plugin::Installer do context "rubygems plugins" do let(:result) do - installer.install(["re-plugin"], :source => file_uri_for(gem_repo2)) + installer.install(["re-plugin"], source: file_uri_for(gem_repo2)) end it "returns the installed spec after installing " do @@ -113,7 +112,7 @@ RSpec.describe Bundler::Plugin::Installer do context "multiple plugins" do let(:result) do - installer.install(["re-plugin", "ma-plugin"], :source => file_uri_for(gem_repo2)) + installer.install(["re-plugin", "ma-plugin"], source: file_uri_for(gem_repo2)) end it "returns the installed spec after installing " do |