class ChefSpec::Error::NotStubbed

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method ChefSpec::Error::ChefSpecError::new
# File lib/chefspec/errors.rb, line 15
def initialize(options = {})
  name  = self.class.name.to_s.split("::").last
  type  = Util.underscore(name).gsub("_not_stubbed", "")
  klass = Stubs.const_get(name.gsub("NotStubbed", "") + "Stub")
  stub  = klass.new(*options[:args]).and_return("...").signature

  signature = "#{type}(#{options[:args].map(&:inspect).join(", ")})"

  super({
    type:      type,
    signature: signature,
    stub:      stub,
    _template: :not_stubbed,
  }.merge(options))
end