Class: Inspec::DescribeBase
- Inherits:
-
Object
- Object
- Inspec::DescribeBase
- Defined in:
- lib/inspec/describe.rb
Instance Method Summary collapse
- #describe(*args, &block) ⇒ Object
-
#initialize(action) ⇒ DescribeBase
constructor
A new instance of DescribeBase.
-
#one(&block) ⇒ nil
Evaluate the given block and collect all checks.
Constructor Details
#initialize(action) ⇒ DescribeBase
Returns a new instance of DescribeBase.
7 8 9 10 |
# File 'lib/inspec/describe.rb', line 7 def initialize(action) @action = action @checks = [] end |
Instance Method Details
#describe(*args, &block) ⇒ Object
23 24 25 |
# File 'lib/inspec/describe.rb', line 23 def describe(*args, &block) @checks.push(['describe', args, block]) end |
#one(&block) ⇒ nil
Evaluate the given block and collect all checks. These will be registered with the callback function under the ‘describe.one’ name.
17 18 19 20 21 |
# File 'lib/inspec/describe.rb', line 17 def one(&block) return unless block_given? instance_eval(&block) @action.call('describe.one', @checks, nil) end |