Exception: ChefSpec::Error::ChefSpecError
- Inherits:
-
StandardError
- Object
- StandardError
- ChefSpec::Error::ChefSpecError
- Defined in:
- lib/chefspec/errors.rb
Direct Known Subclasses
CookbookPathNotFound, ErbTemplateParseError, GemLoadError, InvalidBerkshelfOptions, MayNeedToSpecifyPlatform, NoConversionError, NotStubbed, ShellOutNotStubbed, TemplateNotFound
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ChefSpecError
constructor
A new instance of ChefSpecError.
Constructor Details
#initialize(options = {}) ⇒ ChefSpecError
Returns a new instance of ChefSpecError.
4 5 6 7 8 9 10 11 |
# File 'lib/chefspec/errors.rb', line 4 def initialize( = {}) class_name = self.class.to_s.split("::").last filename = .delete(:_template) || Util.underscore(class_name) template = ChefSpec.root.join("templates", "errors", "#{filename}.erb") erb = Erubis::Eruby.new(File.read(template)) super erb.evaluate() end |