changes bootstrap to accept array of args (vs varargs)

This commit is contained in:
Adam Strickland
2018-06-07 15:15:00 -07:00
parent 179aaab36e
commit e569aa0aa6
3 changed files with 5 additions and 5 deletions

View File

@@ -4,4 +4,4 @@ $:.unshift File.expand_path("../../lib/", __FILE__)
require "thor"
require "tmuxinator"
Tmuxinator::Cli.bootstrap *ARGV
Tmuxinator::Cli.bootstrap ARGV

View File

@@ -364,7 +364,7 @@ module Tmuxinator
# array or ARGV, not a varargs. Perhaps ::bootstrap should as well?
# - ::start has a different purpose from #start and hence a different
# signature
def self.bootstrap(*args)
def self.bootstrap(args = [])
name = args[0] || nil
if args.empty? && Tmuxinator::Config.local?
Tmuxinator::Cli.new.local

View File

@@ -43,13 +43,13 @@ describe Tmuxinator::Cli do
context "base thor functionality" do
shared_examples_for :base_thor_functionality do
it "supports -v" do
out, err = capture_io { cli.bootstrap("-v") }
out, err = capture_io { cli.bootstrap(["-v"]) }
expect(err).to eq ""
expect(out).to include(Tmuxinator::VERSION)
end
it "supports help" do
out, err = capture_io { cli.bootstrap("help") }
out, err = capture_io { cli.bootstrap(["help"]) }
expect(err).to eq ""
expect(out).to include("tmuxinator commands:")
end
@@ -65,7 +65,7 @@ describe Tmuxinator::Cli do
end
describe "::bootstrap" do
subject { cli.bootstrap(*args) }
subject { cli.bootstrap(args) }
let(:args) { [] }
shared_examples_for :bootstrap_with_arguments do