Class: Vagabond::Spec

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions, Actions::Status, Helpers
Defined in:
lib/vagabond/spec.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Actions::Status

included

Methods included from Helpers

included

Constructor Details

#initialize(*args) ⇒ Spec

Returns a new instance of Spec.



22
23
24
25
26
# File 'lib/vagabond/spec.rb', line 22

def initialize(*args)
  @name = nil
  super
  base_setup(:no_configure, :no_validate)
end

Class Method Details

.basenameObject



18
19
20
# File 'lib/vagabond/spec.rb', line 18

def self.basename
  'vagabond spec'
end

Instance Method Details

#destroy(cluster) ⇒ Object



73
74
75
# File 'lib/vagabond/spec.rb', line 73

def destroy(cluster)
  options[:node] ? node_destroy(cluster, options[:node]) : cluster_destroy(cluster)
end

#initObject



83
84
85
86
87
88
# File 'lib/vagabond/spec.rb', line 83

def init
  ui.info "Initializing spec configuration..."
  make_spec_directory
  populate_spec_directory
  ui.info "  -> #{ui.color('COMPLETE!', :green)}"
end

#start(cluster = nil) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/vagabond/spec.rb', line 48

def start(cluster=nil)
  error = nil
  begin
    if(options[:irl])
      irl_spec(cluster)
    else
      cluster_spec(cluster)
      cluster_destroy(cluster) if options[:auto_destroy]
    end
  rescue => error
    ui.error "Unexpected error encountered: #{error}"
    debug("#{error.class}: #{error}\n#{error.backtrace.join("\n")}")
    raise
  ensure
    result = error ? ui.color('FAILED', :red, :bold) : ui.color('PASSED', :green, :bold)
    ui.info "--> Specs for cluster #{cluster}: #{result}"
    raise VagabondError::SpecFailed.new(error) if error
  end
end

#status(name = nil) ⇒ Object



78
79
80
# File 'lib/vagabond/spec.rb', line 78

def status(name=nil)
  _status
end