Class: Souschef::Testkitchen
- Inherits:
-
Object
- Object
- Souschef::Testkitchen
- Defined in:
- lib/souschef/testkitchen.rb,
lib/souschef/testkitchen/docker.rb,
lib/souschef/testkitchen/solusvm.rb,
lib/souschef/testkitchen/virtualbox.rb
Overview
TestKitchen generator
Defined Under Namespace
Classes: Docker, Solusvm, Virtualbox
Instance Attribute Summary collapse
-
#cookbook ⇒ Object
Returns the value of attribute cookbook.
-
#files ⇒ Object
Returns the value of attribute files.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
-
#configure ⇒ Object
Public - Write down TestKitchen configuration.
-
#initialize(opts) ⇒ Testkitchen
constructor
A new instance of Testkitchen.
-
#setup ⇒ Object
Public - Copy the already generated files from the data/ directory.
Constructor Details
#initialize(opts) ⇒ Testkitchen
Returns a new instance of Testkitchen.
10 11 12 13 14 15 |
# File 'lib/souschef/testkitchen.rb', line 10 def initialize(opts) @opts = opts @cookbook = opts[:cookbook] @file = kitchen_driver_file end |
Instance Attribute Details
#cookbook ⇒ Object
Returns the value of attribute cookbook.
8 9 10 |
# File 'lib/souschef/testkitchen.rb', line 8 def cookbook @cookbook end |
#files ⇒ Object
Returns the value of attribute files.
8 9 10 |
# File 'lib/souschef/testkitchen.rb', line 8 def files @files end |
#metadata ⇒ Object
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/souschef/testkitchen.rb', line 8 def @metadata end |
#opts ⇒ Object
Returns the value of attribute opts.
8 9 10 |
# File 'lib/souschef/testkitchen.rb', line 8 def opts @opts end |
Instance Method Details
#configure ⇒ Object
Public - Write down TestKitchen configuration
Returns nil
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/souschef/testkitchen.rb', line 20 def configure if @opts[:docker] Souschef::Print.info 'Creating Docker configuration .kitchen.local.yml' write(:docker, Souschef::Testkitchen::Docker.new(@cookbook).yaml) end if @opts[:solusvm] Souschef::Print.info 'Creating SolusVM configuraton .kitchen.local.yml' write(:solusvm, Souschef::Testkitchen::Solusvm.new(@cookbook).yaml) end Souschef::Print.info 'Creating Vagrant configuration in .kitchen.yml' write(:virtualbox, Souschef::Testkitchen::Virtualbox.new(@cookbook).yaml) end |
#setup ⇒ Object
Public - Copy the already generated files from the data/ directory
Returns nil
37 38 39 40 41 42 |
# File 'lib/souschef/testkitchen.rb', line 37 def setup templates = ['default'] templates << @opts[:testkitchen] if @opts[:testkitchen] templates.each { |type| create_file(type) } end |