summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gems/fund_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/install/gems/fund_spec.rb')
-rw-r--r--spec/bundler/install/gems/fund_spec.rb37
1 files changed, 32 insertions, 5 deletions
diff --git a/spec/bundler/install/gems/fund_spec.rb b/spec/bundler/install/gems/fund_spec.rb
index 57e7c3aed3..f521b0296f 100644
--- a/spec/bundler/install/gems/fund_spec.rb
+++ b/spec/bundler/install/gems/fund_spec.rb
@@ -2,11 +2,38 @@
RSpec.describe "bundle install" do
context "with gem sources" do
+ before do
+ build_repo2 do
+ build_gem "has_funding_and_other_metadata" do |s|
+ s.metadata = {
+ "bug_tracker_uri" => "https://example.com/user/bestgemever/issues",
+ "changelog_uri" => "https://example.com/user/bestgemever/CHANGELOG.md",
+ "documentation_uri" => "https://www.example.info/gems/bestgemever/0.0.1",
+ "homepage_uri" => "https://bestgemever.example.io",
+ "mailing_list_uri" => "https://groups.example.com/bestgemever",
+ "funding_uri" => "https://example.com/has_funding_and_other_metadata/funding",
+ "source_code_uri" => "https://example.com/user/bestgemever",
+ "wiki_uri" => "https://example.com/user/bestgemever/wiki",
+ }
+ end
+
+ build_gem "has_funding", "1.2.3" do |s|
+ s.metadata = {
+ "funding_uri" => "https://example.com/has_funding/funding",
+ }
+ end
+
+ build_gem "gem_with_dependent_funding", "1.0" do |s|
+ s.add_dependency "has_funding"
+ end
+ end
+ end
+
context "when gems include a fund URI" do
it "displays the plural fund message after installing" do
install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
- gem 'has_metadata'
+ source "#{file_uri_for(gem_repo2)}"
+ gem 'has_funding_and_other_metadata'
gem 'has_funding'
gem 'rack-obama'
G
@@ -16,7 +43,7 @@ RSpec.describe "bundle install" do
it "displays the singular fund message after installing" do
install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
+ source "#{file_uri_for(gem_repo2)}"
gem 'has_funding'
gem 'rack-obama'
G
@@ -28,7 +55,7 @@ RSpec.describe "bundle install" do
context "when gems do not include fund messages" do
it "does not display any fund messages" do
install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
+ source "#{file_uri_for(gem_repo2)}"
gem "activesupport"
G
@@ -39,7 +66,7 @@ RSpec.describe "bundle install" do
context "when a dependency includes a fund message" do
it "does not display the fund message" do
install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
+ source "#{file_uri_for(gem_repo2)}"
gem 'gem_with_dependent_funding'
G