diff options
author | Agis Anastasopoulos <agis.anast@gmail.com> | 2015-10-25 12:19:56 +0200 |
---|---|---|
committer | Agis Anastasopoulos <agis.anast@gmail.com> | 2015-10-25 12:19:56 +0200 |
commit | 80cf688bab7ee3ced619c12ac5e2d6dfb0c78c38 (patch) | |
tree | 8e1e29738a728d7184574517b1fec027f2cabcc1 /spec/install | |
parent | 0c459df96d11a917a37fb23262099700abed261f (diff) | |
download | bundler-show-git-rev.tar.gz |
Include revision hash in Source::Git#to_sshow-git-rev
This effectively changes the output of commands that use Source::Git#to_s
(ie. `bundle install`). For example:
Using rack 1.0.0 from git@github.com:rack/rack.git (at master@574b147)
Closes #3433.
Diffstat (limited to 'spec/install')
-rw-r--r-- | spec/install/deploy_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/git_spec.rb | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index ea85229eb8..88832f2145 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -207,7 +207,7 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(out).to include("deployment mode") - expect(out).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)") + expect(out).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}") expect(out).not_to include("You have added to the Gemfile") expect(out).not_to include("You have changed in the Gemfile") end @@ -230,7 +230,7 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(out).to include("deployment mode") - expect(out).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`") + expect(out).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`") expect(out).not_to include("You have added to the Gemfile") expect(out).not_to include("You have deleted from the Gemfile") end diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb new file mode 100644 index 0000000000..7067ec4466 --- /dev/null +++ b/spec/install/git_spec.rb @@ -0,0 +1,17 @@ +require "spec_helper" + +describe "bundle install" do + context "git sources" do + it "displays the revision hash of the gem repository" do + build_git "foo", "1.0", :path => lib_path("foo") + + install_gemfile <<-G + gem "foo", :git => "#{lib_path("foo")}" + G + + bundle :install + expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master@#{revision_for(lib_path("foo"))[0..6]})") + should_be_installed "foo 1.0" + end + end +end |