Permalink
Browse files

Switch the order of arguments to Git#initialize

  • Loading branch information...
1 parent 7e255bf commit 62e9202c7306f2819ad33623300f5efb9486d732 @gabebw gabebw committed Sep 9, 2011
Showing with 6 additions and 11 deletions.
  1. +1 −1 lib/kumade/deployer.rb
  2. +1 −1 lib/kumade/git.rb
  3. +4 −9 spec/kumade/git_spec.rb
@@ -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
View
@@ -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
@@ -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
@@ -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)
@@ -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)

0 comments on commit 62e9202

Please sign in to comment.