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

Commit

Permalink
Switch the order of arguments to Git#initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Sep 9, 2011
1 parent 7e255bf commit 62e9202
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/kumade/deployer.rb
Expand Up @@ -9,7 +9,7 @@ def initialize(environment = 'staging', pretending = false)
super()
@environment = environment
@pretending = pretending
@git = Git.new(pretending, environment)
@git = Git.new(environment, pretending)
@branch = @git.current_branch
end

Expand Down
2 changes: 1 addition & 1 deletion lib/kumade/git.rb
Expand Up @@ -2,7 +2,7 @@
module Kumade
class Git < Base
attr_reader :environment
def initialize(pretending, environment)
def initialize(environment = 'staging', pretending = false)
super()
@pretending = pretending
@environment = environment
Expand Down
13 changes: 4 additions & 9 deletions spec/kumade/git_spec.rb
Expand Up @@ -20,12 +20,12 @@
end

it "returns true when the remote is a heroku repository" do
Kumade::Git.new(false, environment).heroku_remote?.should be_true
Kumade::Git.new(false, another_heroku_environment).heroku_remote?.should be_true
Kumade::Git.new(environment).heroku_remote?.should be_true
Kumade::Git.new(another_heroku_environment).heroku_remote?.should be_true
end

it "returns false when the remote is not a heroku repository" do
Kumade::Git.new(false, 'kumade').heroku_remote?.should be_false
Kumade::Git.new('kumade').heroku_remote?.should be_false
end
end

Expand All @@ -51,10 +51,7 @@

describe Kumade::Git, "#branch_exist?" do
let(:command_line_mock) { mock("Cocaine::CommandLine") }
let(:branch) { "branch" }
let(:environment) { "staging" }

subject { Kumade::Git.new(false, environment) }
let(:branch) { "branch" }

before do
Cocaine::CommandLine.should_receive(:new).with("git show-ref #{branch}").and_return(command_line_mock)
Expand All @@ -73,8 +70,6 @@
end

describe Kumade::Git, "#dirty?" do
subject { Kumade::Git.new(false, "staging") }

it "returns true when dirty" do
subject.should_receive(:run).with("git diff --exit-code").and_return(false)

Expand Down

0 comments on commit 62e9202

Please sign in to comment.