Class: RSpec::Terraspace::Ts

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
Concern
Defined in:
lib/rspec/terraspace/ts.rb

Constant Summary collapse

CLI =
::Terraspace::CLI

Instance Method Summary collapse

Methods included from Concern

#out_path, #output, #outputs, #save_output, #save_state, #state, #state_path, #state_resource

Instance Method Details

#build_test_harness(options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/rspec/terraspace/ts.rb', line 10

def build_test_harness(options={})
  project = Project.new(options)
  root = project.create
  Terraspace.root = root # switch root to the generated test harness
end

#down(args) ⇒ Object



22
23
24
# File 'lib/rspec/terraspace/ts.rb', line 22

def down(args)
  run("down #{args} -y")
end

#run(command) ⇒ Object



26
27
28
29
30
# File 'lib/rspec/terraspace/ts.rb', line 26

def run(command)
  puts "=> TS_ENV=#{Terraspace.env} terraspace #{command}".color(:green)
  args = command.split(' ')
  CLI.start(args)
end

#up(args) ⇒ Object



16
17
18
19
20
# File 'lib/rspec/terraspace/ts.rb', line 16

def up(args)
  run("up #{args} -y")
  mod = args.split(' ').first
  @mod = ::Terraspace::Mod.new(mod)
end