lib/rspec-system/node_set/vagrant.rb in rspec-system-1.2.1 vs lib/rspec-system/node_set/vagrant.rb in rspec-system-1.3.0
- old
+ new
@@ -12,11 +12,12 @@
# Creates a new instance of RSpecSystem::NodeSet::Vagrant
#
# @param setname [String] name of the set to instantiate
# @param config [Hash] nodeset configuration hash
- def initialize(setname, config)
+ # @param options [Hash] options Hash
+ def initialize(setname, config, options)
super
@vagrant_path = File.expand_path(File.join(RSpec.configuration.system_tmp, 'vagrant_projects', setname))
end
# Setup the NodeSet by starting all nodes.
@@ -51,11 +52,15 @@
log.info "[Vagrant#teardown] closing all ssh channels"
RSpec.configuration.ssh_channels.each do |k,v|
v.close unless v.closed?
end
- log.info "[Vagrant#teardown] Running 'vagrant destroy'"
- vagrant("destroy --force")
+ if destroy
+ log.info "[Vagrant#teardown] Running 'vagrant destroy'"
+ vagrant("destroy --force")
+ else
+ log.info "[Vagrant#teardown] Skipping 'vagrant destroy'"
+ end
nil
end
# Run a command on a host in the NodeSet.
#