Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Clean up heroku spec support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Oct 21, 2011
1 parent e9aa04a commit 61d3ee8
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions spec/support/heroku.rb
@@ -1,33 +1,23 @@
shared_context "when on Cedar" do
let(:command_line) { mock("Kumade::CommandLine instance") }
let(:command_line) { mock("Kumade::CommandLine") }
let(:stack_command) { "bundle exec heroku stack --remote staging" }
let(:heroku_output) { ["aspen-mri-1.8.6", "bamboo-mri-1.9.2", "bamboo-ree-1.8.7", "* cedar (beta)"].map { |s| " #{s}"}.join("\n") }

before do
Kumade::CommandLine.expects(:new).
with("bundle exec heroku stack --remote staging").
returns(command_line)
Kumade::CommandLine.expects(:new).with(stack_command).returns(command_line)

command_line.expects(:run_or_error).returns(%{
aspen-mri-1.8.6
bamboo-mri-1.9.2
bamboo-ree-1.8.7
* cedar (beta)
})
command_line.expects(:run_or_error).returns(heroku_output)
end
end

shared_context "when not on Cedar" do
let(:command_line) { mock("Kumade::CommandLine") }
let(:command_line) { mock("Kumade::CommandLine") }
let(:stack_command) { "bundle exec heroku stack --remote staging" }
let(:heroku_output) { ["aspen-mri-1.8.6", "* bamboo-mri-1.9.2", "bamboo-ree-1.8.7", "cedar (beta)"].map {|s| " #{s}" }.join("\n") }

before do
Kumade::CommandLine.expects(:new).
with("bundle exec heroku stack --remote staging").
returns(command_line)
Kumade::CommandLine.expects(:new).with(stack_command).returns(command_line)

command_line.expects(:run_or_error).returns(%{
aspen-mri-1.8.6
* bamboo-mri-1.9.2
bamboo-ree-1.8.7
cedar (beta)
})
command_line.expects(:run_or_error).returns(heroku_output)
end
end

0 comments on commit 61d3ee8

Please sign in to comment.