Extend has_plugin test for gem name and version

The test must ensure that has_plugin does not succeed if an unrelated plugin satisfies the given version spec.
This commit is contained in:
mbrodala 2015-01-20 16:35:57 +01:00
parent cca19f8241
commit e756950e2a
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,7 @@ describe Vagrant do
expect(described_class.has_plugin?("bar")).to be_false expect(described_class.has_plugin?("bar")).to be_false
end end
it "finds plugins by gem version" do it "finds plugins by gem name and version" do
specs = [Gem::Specification.new] specs = [Gem::Specification.new]
specs[0].name = "foo" specs[0].name = "foo"
specs[0].version = "1.2.3" specs[0].version = "1.2.3"
@ -83,6 +83,7 @@ describe Vagrant do
expect(described_class.has_plugin?("foo", "~> 1.2.0")).to be_true expect(described_class.has_plugin?("foo", "~> 1.2.0")).to be_true
expect(described_class.has_plugin?("foo", "~> 1.0.0")).to be_false expect(described_class.has_plugin?("foo", "~> 1.0.0")).to be_false
expect(described_class.has_plugin?("bar", "~> 1.2.0")).to be_false
end end
end end