From 00afb3cedc7046c9c26f5666099ebaa60f3185db Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Sat, 19 Oct 2013 17:10:10 -0700 Subject: move invalid specs to gemfile and path specs --- spec/install/gemfile_spec.rb | 33 ++++++++++++++++++++++------- spec/install/invalid_spec.rb | 50 -------------------------------------------- spec/install/path_spec.rb | 18 ++++++++++++++++ 3 files changed, 43 insertions(+), 58 deletions(-) delete mode 100644 spec/install/invalid_spec.rb (limited to 'spec') diff --git a/spec/install/gemfile_spec.rb b/spec/install/gemfile_spec.rb index c553b629ff..497aab065d 100644 --- a/spec/install/gemfile_spec.rb +++ b/spec/install/gemfile_spec.rb @@ -1,13 +1,30 @@ require "spec_helper" -describe "bundle install with Gemfile" do - - it "will display a warning if a gem is duplicated" do - install_gemfile <<-G - gem 'rails', '~> 4.0.0' - gem 'rails', '~> 4.0.0' - G - expect(out).to include("more than once") +describe "bundle install" do + + context "with duplicated gems" do + it "will display a warning" do + install_gemfile <<-G + gem 'rails', '~> 4.0.0' + gem 'rails', '~> 4.0.0' + G + expect(out).to include("more than once") + end + end + + context "with deprecated features" do + before :each do + in_app_root + end + + it "reports that lib is an invalid option" do + gemfile <<-G + gem "rack", :lib => "rack" + G + + bundle :install + expect(out).to match(/You passed :lib as an option for gem 'rack', but it is invalid/) + end end end \ No newline at end of file diff --git a/spec/install/invalid_spec.rb b/spec/install/invalid_spec.rb deleted file mode 100644 index 3dd8a4ff72..0000000000 --- a/spec/install/invalid_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -require "spec_helper" - -describe "bundle install with deprecated features" do - before :each do - in_app_root - end - - it "reports that lib is an invalid option" do - gemfile <<-G - gem "rack", :lib => "rack" - G - - bundle :install - expect(out).to match(/You passed :lib as an option for gem 'rack', but it is invalid/) - end - -end - -describe "bundle install to a dead symlink" do - before do - in_app_root do - `ln -s /tmp/idontexist bundle` - end - end - - it "reports the symlink is dead" do - gemfile <<-G - source "file://#{gem_repo1}" - gem "rack" - G - - bundle "install --path bundle" - expect(out).to match(/invalid symlink/) - end -end - -describe "invalid or inaccessible gem source" do - it "can be retried" do - gemfile <<-G - source "file://#{gem_repo_missing}" - gem "rack" - gem "signed_gem" - G - bundle "install", :retry => 2 - exp = Regexp.escape("Retrying source fetch due to error (2/3)") - expect(out).to match(exp) - exp = Regexp.escape("Retrying source fetch due to error (3/3)") - expect(out).to match(exp) - end -end \ No newline at end of file diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index ef95f99cc6..c5c7e0db2f 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -129,4 +129,22 @@ describe "bundle install" do end end + describe "to a dead symlink" do + before do + in_app_root do + `ln -s /tmp/idontexist bundle` + end + end + + it "reports the symlink is dead" do + gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + + bundle "install --path bundle" + expect(out).to match(/invalid symlink/) + end + end + end \ No newline at end of file -- cgit v1.2.1