summaryrefslogtreecommitdiff
path: root/spec/install/yanked_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/install/yanked_spec.rb')
-rw-r--r--spec/install/yanked_spec.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/install/yanked_spec.rb b/spec/install/yanked_spec.rb
new file mode 100644
index 0000000000..2f8af3fe5a
--- /dev/null
+++ b/spec/install/yanked_spec.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+require "spec_helper"
+
+describe "handle yanked" do
+ before(:each) do
+ build_repo4 do
+ build_gem "foo", "9.0.0"
+ end
+ end
+
+ it "throws and error when there is gem yanked" do
+ lockfile <<-L
+ GEM
+ remote: file://#{gem_repo4}
+ specs:
+ foo (10.0.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ foo (= 10.0.0)
+
+ L
+
+ install_gemfile <<-G
+ source "file://#{gem_repo4}"
+ gem "foo", "10.0.0"
+ G
+
+ expect(out).to include("Your bundle is locked to foo (10.0.0)")
+ end
+
+ it "throws the original error when manually enter a version number that doesn't exist" do
+ install_gemfile <<-G
+ source "file://#{gem_repo4}"
+ gem "foo", "10.0.0"
+ G
+
+ expect(out).not_to include("Your bundle is locked to foo (10.0.0)")
+ expect(out).to include("Could not find gem 'foo (= 10.0.0)' in any of the gem sources")
+ end
+end \ No newline at end of file