Remove branch option (it should be interpreted)

This commit is contained in:
Seth Vargo 2014-11-13 17:46:54 -05:00
parent ce380a3b12
commit 1f49b7ef62
2 changed files with 0 additions and 30 deletions

View File

@ -22,17 +22,12 @@ module VagrantPlugins
# @return [String]
attr_accessor :remote
# The Git branch to push to (default: "master").
# @return [String]
attr_accessor :branch
def initialize
@app = UNSET_VALUE
@dir = UNSET_VALUE
@git_bin = UNSET_VALUE
@remote = UNSET_VALUE
@branch = UNSET_VALUE
end
def finalize!
@ -41,7 +36,6 @@ module VagrantPlugins
@git_bin = "git" if @git_bin == UNSET_VALUE
@remote = "heroku" if @remote == UNSET_VALUE
@branch = "master" if @branch == UNSET_VALUE
end
def validate(machine)
@ -65,12 +59,6 @@ module VagrantPlugins
)
end
if missing?(@branch)
errors << I18n.t("heroku_push.errors.missing_attribute",
attribute: "branch",
)
end
{ "Heroku push" => errors }
end

View File

@ -42,13 +42,6 @@ describe VagrantPlugins::HerokuPush::Config do
end
end
describe "#branch" do
it "defaults to git" do
subject.finalize!
expect(subject.branch).to eq("master")
end
end
describe "#validate" do
before do
allow(machine).to receive(:env)
@ -60,7 +53,6 @@ describe VagrantPlugins::HerokuPush::Config do
subject.dir = "."
subject.git_bin = "git"
subject.remote = "heroku"
subject.branch = "master"
end
let(:result) { subject.validate(machine) }
@ -94,16 +86,6 @@ describe VagrantPlugins::HerokuPush::Config do
end
end
context "when the branch is missing" do
it "returns an error" do
subject.branch = ""
subject.finalize!
expect(errors).to include(I18n.t("heroku_push.errors.missing_attribute",
attribute: "branch",
))
end
end
context "when the dir is missing" do
it "returns an error" do
subject.dir = ""