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.
| 3 4 5 6 | # File 'lib/inspec/describe.rb', line 3 def initialize(action) @action = action @checks = [] end | 
Instance Method Details
#describe(*args, &block) ⇒ Object
| 20 21 22 | # File 'lib/inspec/describe.rb', line 20 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.
| 13 14 15 16 17 18 | # File 'lib/inspec/describe.rb', line 13 def one(&block) return unless block_given? instance_eval(&block) @action.call("describe.one", @checks, nil) end |