diff --git a/build.gradle b/build.gradle index fd28b9984..00514ff38 100644 --- a/build.gradle +++ b/build.gradle @@ -307,7 +307,7 @@ tasks.register("installBundler") { dependsOn assemblyDeps outputs.files file("${projectDir}/vendor/bundle/jruby/2.5.0/bin/bundle") doLast { - gem(projectDir, buildDir, "bundler", "= 2.3.6", "${projectDir}/vendor/bundle/jruby/2.5.0") + gem(projectDir, buildDir, "bundler", "~> 2", "${projectDir}/vendor/bundle/jruby/2.5.0") } } @@ -435,7 +435,7 @@ tasks.register("installIntegrationTestBundler"){ dependsOn unpackTarDistribution outputs.files file("${qaBundleBin}") doLast { - gem(projectDir, buildDir, "bundler", "= 2.3.6", qaBundledGemPath) + gem(projectDir, buildDir, "bundler", "~> 2", qaBundledGemPath) } } diff --git a/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest.gemspec b/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest.gemspec index 78a7a1d48..49d8922c0 100644 --- a/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest.gemspec +++ b/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest.gemspec @@ -4,7 +4,6 @@ Gem::Specification.new do |spec| spec.version = "0.0.1" spec.authors = ["Elastic"] spec.email = ["info@elastic.co"] - spec.summary = "a summary" spec.description = "a description" spec.homepage = "https://elastic.co" diff --git a/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest_pim-0.0.1.gem b/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest_pim-0.0.1.gem new file mode 100644 index 000000000..a7ecc37be Binary files /dev/null and b/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest_pim-0.0.1.gem differ diff --git a/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest_pim.gemspec b/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest_pim.gemspec new file mode 100644 index 000000000..fbb1c92cb --- /dev/null +++ b/spec/support/pack/valid-pack/logstash/valid-pack/logstash-input-packtest_pim.gemspec @@ -0,0 +1,12 @@ +# coding: utf-8 +Gem::Specification.new do |spec| + spec.name = "logstash-input-packtest_pim" + spec.version = "0.0.1" + spec.authors = ["Elastic"] + spec.email = ["info@elastic.co"] + spec.post_install_message = "Hello from the friendly pack" + spec.summary = "a summary" + spec.description = "a description" + spec.homepage = "https://elastic.co" + spec.add_runtime_dependency "logstash-input-packtestdep" +end diff --git a/spec/unit/plugin_manager/gem_installer_spec.rb b/spec/unit/plugin_manager/gem_installer_spec.rb index cf57c9c4a..dd85009df 100644 --- a/spec/unit/plugin_manager/gem_installer_spec.rb +++ b/spec/unit/plugin_manager/gem_installer_spec.rb @@ -46,9 +46,7 @@ describe LogStash::PluginManager::GemInstaller do let(:message) { "Hello from the friendly pack" } context "when present" do - before do - allow_any_instance_of(::Gem::Specification).to receive(:post_install_message).and_return(message) - end + let(:plugin_name) { 'logstash-input-packtest_pim-0.0.1' } context "when we want the message" do it "display the message" do @@ -64,7 +62,7 @@ describe LogStash::PluginManager::GemInstaller do end context "when not present" do - context "when we want the message" do + context "when we don't want the message" do it "doesn't display the message" do expect(LogStash::PluginManager.ui).not_to receive(:info).with(message) subject.install(simple_gem, true, temporary_gem_home) diff --git a/spec/unit/plugin_manager/pack_installer/pack_spec.rb b/spec/unit/plugin_manager/pack_installer/pack_spec.rb index 617c0adc0..5467dd2f8 100644 --- a/spec/unit/plugin_manager/pack_installer/pack_spec.rb +++ b/spec/unit/plugin_manager/pack_installer/pack_spec.rb @@ -29,8 +29,8 @@ describe LogStash::PluginManager::PackInstaller::Pack do end it "returns the plugins" do - expect(subject.plugins.size).to eq(1) - expect(subject.plugins.collect(&:name)).to include("logstash-input-packtest") + expect(subject.plugins.size).to eq(2) + expect(subject.plugins.collect(&:name)).to include("logstash-input-packtest_pim", "logstash-input-packtest") end it "returns the dependencies" do @@ -39,8 +39,8 @@ describe LogStash::PluginManager::PackInstaller::Pack do end it "returns all the gems" do - expect(subject.gems.size).to eq(2) - expect(subject.gems.collect(&:name)).to include("logstash-input-packtest", "logstash-input-packtestdep") + expect(subject.gems.size).to eq(3) + expect(subject.gems.collect(&:name)).to include("logstash-input-packtest", "logstash-input-packtest_pim", "logstash-input-packtestdep") end end