Remove branch option (it should be interpreted)
This commit is contained in:
parent
ce380a3b12
commit
1f49b7ef62
|
@ -22,17 +22,12 @@ module VagrantPlugins
|
||||||
# @return [String]
|
# @return [String]
|
||||||
attr_accessor :remote
|
attr_accessor :remote
|
||||||
|
|
||||||
# The Git branch to push to (default: "master").
|
|
||||||
# @return [String]
|
|
||||||
attr_accessor :branch
|
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@app = UNSET_VALUE
|
@app = UNSET_VALUE
|
||||||
@dir = UNSET_VALUE
|
@dir = UNSET_VALUE
|
||||||
|
|
||||||
@git_bin = UNSET_VALUE
|
@git_bin = UNSET_VALUE
|
||||||
@remote = UNSET_VALUE
|
@remote = UNSET_VALUE
|
||||||
@branch = UNSET_VALUE
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def finalize!
|
def finalize!
|
||||||
|
@ -41,7 +36,6 @@ module VagrantPlugins
|
||||||
|
|
||||||
@git_bin = "git" if @git_bin == UNSET_VALUE
|
@git_bin = "git" if @git_bin == UNSET_VALUE
|
||||||
@remote = "heroku" if @remote == UNSET_VALUE
|
@remote = "heroku" if @remote == UNSET_VALUE
|
||||||
@branch = "master" if @branch == UNSET_VALUE
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate(machine)
|
def validate(machine)
|
||||||
|
@ -65,12 +59,6 @@ module VagrantPlugins
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if missing?(@branch)
|
|
||||||
errors << I18n.t("heroku_push.errors.missing_attribute",
|
|
||||||
attribute: "branch",
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
{ "Heroku push" => errors }
|
{ "Heroku push" => errors }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,13 +42,6 @@ describe VagrantPlugins::HerokuPush::Config do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#branch" do
|
|
||||||
it "defaults to git" do
|
|
||||||
subject.finalize!
|
|
||||||
expect(subject.branch).to eq("master")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#validate" do
|
describe "#validate" do
|
||||||
before do
|
before do
|
||||||
allow(machine).to receive(:env)
|
allow(machine).to receive(:env)
|
||||||
|
@ -60,7 +53,6 @@ describe VagrantPlugins::HerokuPush::Config do
|
||||||
subject.dir = "."
|
subject.dir = "."
|
||||||
subject.git_bin = "git"
|
subject.git_bin = "git"
|
||||||
subject.remote = "heroku"
|
subject.remote = "heroku"
|
||||||
subject.branch = "master"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:result) { subject.validate(machine) }
|
let(:result) { subject.validate(machine) }
|
||||||
|
@ -94,16 +86,6 @@ describe VagrantPlugins::HerokuPush::Config do
|
||||||
end
|
end
|
||||||
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
|
context "when the dir is missing" do
|
||||||
it "returns an error" do
|
it "returns an error" do
|
||||||
subject.dir = ""
|
subject.dir = ""
|
||||||
|
|
Loading…
Reference in New Issue