From 07965169a1eb40bfd202767ccc05c19ad8875527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 18 Sep 2018 20:01:48 -0300 Subject: Rename spec file to use the preferred option name --- spec/install/force_spec.rb | 62 ----------------------------------------- spec/install/redownload_spec.rb | 62 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 spec/install/force_spec.rb create mode 100644 spec/install/redownload_spec.rb diff --git a/spec/install/force_spec.rb b/spec/install/force_spec.rb deleted file mode 100644 index 52fa4f0d61..0000000000 --- a/spec/install/force_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe "bundle install" do - %w[force redownload].each do |flag| - describe_opts = {} - describe_opts[:bundler] = "< 2" if flag == "force" - describe "with --#{flag}", describe_opts do - before :each do - gemfile <<-G - source "file://#{gem_repo1}" - gem "rack" - G - end - - it "re-installs installed gems" do - rack_lib = default_bundle_path("gems/rack-1.0.0/lib/rack.rb") - - bundle! :install - rack_lib.open("w") {|f| f.write("blah blah blah") } - bundle! :install, flag => true - - expect(out).to include "Installing rack 1.0.0" - expect(rack_lib.open(&:read)).to eq("RACK = '1.0.0'\n") - expect(the_bundle).to include_gems "rack 1.0.0" - end - - it "works on first bundle install" do - bundle! :install, flag => true - - expect(out).to include "Installing rack 1.0.0" - expect(the_bundle).to include_gems "rack 1.0.0" - end - - context "with a git gem" do - let!(:ref) { build_git("foo", "1.0").ref_for("HEAD", 11) } - - before do - gemfile <<-G - gem "foo", :git => "#{lib_path("foo-1.0")}" - G - end - - it "re-installs installed gems" do - foo_lib = default_bundle_path("bundler/gems/foo-1.0-#{ref}/lib/foo.rb") - - bundle! :install - foo_lib.open("w") {|f| f.write("blah blah blah") } - bundle! :install, flag => true - - expect(foo_lib.open(&:read)).to eq("FOO = '1.0'\n") - expect(the_bundle).to include_gems "foo 1.0" - end - - it "works on first bundle install" do - bundle! :install, flag => true - - expect(the_bundle).to include_gems "foo 1.0" - end - end - end - end -end diff --git a/spec/install/redownload_spec.rb b/spec/install/redownload_spec.rb new file mode 100644 index 0000000000..52fa4f0d61 --- /dev/null +++ b/spec/install/redownload_spec.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +RSpec.describe "bundle install" do + %w[force redownload].each do |flag| + describe_opts = {} + describe_opts[:bundler] = "< 2" if flag == "force" + describe "with --#{flag}", describe_opts do + before :each do + gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + end + + it "re-installs installed gems" do + rack_lib = default_bundle_path("gems/rack-1.0.0/lib/rack.rb") + + bundle! :install + rack_lib.open("w") {|f| f.write("blah blah blah") } + bundle! :install, flag => true + + expect(out).to include "Installing rack 1.0.0" + expect(rack_lib.open(&:read)).to eq("RACK = '1.0.0'\n") + expect(the_bundle).to include_gems "rack 1.0.0" + end + + it "works on first bundle install" do + bundle! :install, flag => true + + expect(out).to include "Installing rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" + end + + context "with a git gem" do + let!(:ref) { build_git("foo", "1.0").ref_for("HEAD", 11) } + + before do + gemfile <<-G + gem "foo", :git => "#{lib_path("foo-1.0")}" + G + end + + it "re-installs installed gems" do + foo_lib = default_bundle_path("bundler/gems/foo-1.0-#{ref}/lib/foo.rb") + + bundle! :install + foo_lib.open("w") {|f| f.write("blah blah blah") } + bundle! :install, flag => true + + expect(foo_lib.open(&:read)).to eq("FOO = '1.0'\n") + expect(the_bundle).to include_gems "foo 1.0" + end + + it "works on first bundle install" do + bundle! :install, flag => true + + expect(the_bundle).to include_gems "foo 1.0" + end + end + end + end +end -- cgit v1.2.1