Remove description of custom resource

- will be superseded by compliance profiles
This commit is contained in:
Christoph Hartmann 2015-11-30 19:49:54 +01:00
parent bf0ab1b7cd
commit c4dcd17f82

View file

@ -152,43 +152,6 @@ Which will provide you with:
{"family":"ubuntu","release":"14.04","arch":null}
```
## Custom InSpec resources
You can easily create your own resources. Here is a custom resource for an
application called Gordon. It is saved as `gordon_config.rb`.
```ruby
require 'yaml'
class GordonConfig < Inspec.resource(1)
name 'gordon_config'
def initialize
@path = '/etc/gordon/config.yaml'
@config = inspec.file(@path).content
@params = YAML.load(@config)
end
def method_missing(name)
@params[name.to_s]
end
end
```
Include this file in your `test.rb`:
```ruby
require_relative 'gordon_config'
```
Now you can start using your new resource:
```ruby
describe gordon_config do
its('Version') { should eq('1.0') }
end
```
## Documentation
Documentation is available: https://github.com/chef/inspec/tree/master/docs