summaryrefslogtreecommitdiff
path: root/spec/other
diff options
context:
space:
mode:
authorMyron Marston <myron.marston@gmail.com>2010-08-27 08:58:51 -0700
committerJoshua Hull <joshbuddy@gmail.com>2010-08-27 20:36:22 -0500
commit3e6cc69ae723e355202fa74b1c3d4b4428d70a24 (patch)
tree61ab9d0411fb023a141a7946fac1e761426fa30d /spec/other
parent14f497523f4e7aad69b12a6d9d3c72403c75f2d9 (diff)
downloadbundler-3e6cc69ae723e355202fa74b1c3d4b4428d70a24.tar.gz
Add appropriate confirm messages to gem helper commands.
Diffstat (limited to 'spec/other')
-rw-r--r--spec/other/gem_helper_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/other/gem_helper_spec.rb b/spec/other/gem_helper_spec.rb
index f4ef12cb64..39acf77830 100644
--- a/spec/other/gem_helper_spec.rb
+++ b/spec/other/gem_helper_spec.rb
@@ -26,6 +26,14 @@ describe "Bundler::GemHelper tasks" do
end
context "gem management" do
+ def mock_confirm_message(message)
+ Bundler.ui.should_receive(:confirm).with(message)
+ end
+
+ def mock_build_message
+ mock_confirm_message "test 0.0.1 built to pkg/test-0.0.1.gem"
+ end
+
before(:each) do
bundle 'gem test'
@app = bundled_app("test")
@@ -34,12 +42,19 @@ describe "Bundler::GemHelper tasks" do
@helper = Bundler::GemHelper.new(@app.to_s)
end
+ it "uses a shell UI for output" do
+ Bundler.ui.should be_a(Bundler::UI::Shell)
+ end
+
it "builds" do
+ mock_build_message
@helper.build_gem
bundled_app('test/pkg/test-0.0.1.gem').should exist
end
it "installs" do
+ mock_build_message
+ mock_confirm_message "test (0.0.1) installed"
@helper.install_gem
bundled_app('test/pkg/test-0.0.1.gem').should exist
%x{gem list}.should include("test (0.0.1)")
@@ -50,6 +65,10 @@ describe "Bundler::GemHelper tasks" do
end
it "pushes" do
+ mock_build_message
+ mock_confirm_message /Tagged [\da-f]+ with v0.0.1/
+ mock_confirm_message "Pushed git commits and tags"
+
@helper.should_receive(:rubygem_push).with(bundled_app('test/pkg/test-0.0.1.gem').to_s)
Dir.chdir(@app) {
`git init --bare #{gem_repo1}`