Class: VagrantSpec::Command::Test

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/vagrant_spec/command/test.rb

Overview

This command instantiates serveral files for deployment and testing

argv env [Vagrant::Environment]

Instance Method Summary collapse

Methods included from Utils

#lib_root, #project_root, #template_dir

Constructor Details

#initialize(argv, env) ⇒ Test

Returns a new instance of Test.



14
15
16
# File 'lib/vagrant_spec/command/test.rb', line 14

def initialize(argv, env)
  super
end

Instance Method Details

#executeObject



18
19
20
21
# File 'lib/vagrant_spec/command/test.rb', line 18

def execute
  return unless parse_opts
  VagrantSpec::TestPlan.new(@env).run
end

#parse_optsObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/vagrant_spec/command/test.rb', line 23

def parse_opts
  opts = OptionParser.new do |o|
    o.banner = "\nTest: Run the tests configured in the Vagrantfile"
    o.separator ''
    o.separator 'Usage: vagrant spec test'
    o.separator ''
    o.separator IO.read(File.join(template_dir, 'test_help'))
  end
  parse_options(opts)
end