Class: Halite::SpecHelper::Runner

Inherits:
ChefSpec::SoloRunner
  • Object
show all
Defined in:
lib/halite/spec_helper/runner.rb

Overview

ChefSpec runner class with Halite customizations. This adds attribute options, Halite synthetic cookbook injection, and block-based recipes.

Since:

  • 1.0.0

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.

Since:

  • 1.0.0



33
34
35
36
37
# File 'lib/halite/spec_helper/runner.rb', line 33

def initialize(options={})
  # Store the gemspec for later use
  @halite_gemspec = options[:halite_gemspec]
  super
end

Instance Method Details

#converge(*args, &block) ⇒ Object

Since:

  • 1.0.0



42
43
44
45
46
47
# File 'lib/halite/spec_helper/runner.rb', line 42

def converge(*args, &block)
  super(*args) do |node|
    add_halite_cookbooks(node, @halite_gemspec) if @halite_gemspec
    block.call(node) if block
  end
end

#preload!Object

Since:

  • 1.0.0



39
40
# File 'lib/halite/spec_helper/runner.rb', line 39

def preload!
end