Skip to content

Commit

Permalink
Fix stub of user, add json as dependency for some Ruby versions
Browse files Browse the repository at this point in the history
  • Loading branch information
iain committed Apr 5, 2012
1 parent 012a2ad commit 7f42e66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions capistrano-blaze.gemspec
Expand Up @@ -18,4 +18,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "rspec", "~> 2.9" gem.add_development_dependency "rspec", "~> 2.9"
gem.add_development_dependency "webmock", "~> 1.8.4" gem.add_development_dependency "webmock", "~> 1.8.4"
gem.add_development_dependency "rake", "~> 0.9.2" gem.add_development_dependency "rake", "~> 0.9.2"
gem.add_dependency "json"
end end
12 changes: 6 additions & 6 deletions spec/camp_spec.rb
Expand Up @@ -24,24 +24,24 @@
end end


before do before do
subject.stub(:user) { "iain" } Capistrano::Blaze::Messages.any_instance.stub(:user) { "your mom" }
end end


it "displays a start message" do it "displays a start message" do
subject.should_receive(:speak).with("iain is deploying to the production stage of basecamp, via `#{command}`") subject.should_receive(:speak).with("your mom is deploying to the production stage of basecamp, via `#{command}`")
context = stub(:stage => "production", :application => "basecamp") context = stub(:stage => "production", :application => "basecamp")
subject.start(context) subject.start(context)
end end


it "displays a failure message" do it "displays a failure message" do
subject.should_receive(:speak).with(":warning: iain failed to deploy to the production stage of basecamp, via `#{command}`: woops (RuntimeError)") subject.should_receive(:speak).with(":warning: your mom failed to deploy to the production stage of basecamp, via `#{command}`: woops (RuntimeError)")
context = stub(:stage => "production", :application => "basecamp") context = stub(:stage => "production", :application => "basecamp")
exception = RuntimeError.new("woops") exception = RuntimeError.new("woops")
subject.failure(context, exception) subject.failure(context, exception)
end end


it "displays success message" do it "displays success message" do
subject.should_receive(:speak).with("iain succesfully deployed to the production stage of basecamp, via `#{command}`") subject.should_receive(:speak).with("your mom succesfully deployed to the production stage of basecamp, via `#{command}`")
context = stub(:stage => "production", :application => "basecamp") context = stub(:stage => "production", :application => "basecamp")
subject.success(context) subject.success(context)
end end
Expand All @@ -53,13 +53,13 @@
end end


it "displays success message without a stage" do it "displays success message without a stage" do
subject.should_receive(:speak).with("iain succesfully deployed basecamp, via `#{command}`") subject.should_receive(:speak).with("your mom succesfully deployed basecamp, via `#{command}`")
context = stub(:application => "basecamp") context = stub(:application => "basecamp")
subject.success(context) subject.success(context)
end end


it "displays failure message without a stage" do it "displays failure message without a stage" do
subject.should_receive(:speak).with(":warning: iain failed to deploy basecamp, via `#{command}`: woops (RuntimeError)") subject.should_receive(:speak).with(":warning: your mom failed to deploy basecamp, via `#{command}`: woops (RuntimeError)")
context = stub(:application => "basecamp") context = stub(:application => "basecamp")
exception = RuntimeError.new("woops") exception = RuntimeError.new("woops")
subject.failure(context, exception) subject.failure(context, exception)
Expand Down

0 comments on commit 7f42e66

Please sign in to comment.