Sha256: 0e83fc116bd18e12d90929650aba33e1f659a6bdfa559f44a7e8a1bb0fe27c4f

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

require 'beaker-rspec/beaker_shim'
require "beaker-rspec/helpers/serverspec"
include BeakerRSpec::BeakerShim

RSpec.configure do |c|
  # Enable color
  c.tty = true

  # Define persistant hosts setting
  c.add_setting :hosts, :default => []

  # Defined target nodeset
  nodeset = ENV['RSPEC_SET'] || 'default'
  nodesetfile = ENV['RSPEC_SETFILE'] || File.join('spec/acceptance/nodesets',"#{nodeset}.yml")

  preserve = ENV['RSPEC_DESTROY'] ? '--preserve-hosts' : ''
  fresh_nodes = ENV['RSPEC_NO_PROVISION'] ? '--no-provision' : ''

  # Configure all nodes in nodeset
  c.setup([preserve, fresh_nodes, '--type','git','--hosts', nodesetfile])
  c.provision
  c.validate

  # Destroy nodes if no preserve hosts
  c.after :suite do
    c.cleanup
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
beaker-rspec-1.0.0 lib/beaker-rspec/spec_helper.rb