Sha256: 67de8e9ede0a0b1c3c17672797641bba34c2bca8b7ab0105f3b301cb84a5ee4f

Contents?: true

Size: 688 Bytes

Versions: 6

Compression:

Stored size: 688 Bytes

Contents

# encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann

module Inspec
  class DescribeBase
    def initialize(action)
      @action = action
      @checks = []
    end

    # Evaluate the given block and collect all checks. These will be registered
    # with the callback function under the 'describe.one' name.
    #
    # @param [Proc] ruby block containing checks (e.g. via describe)
    # @return [nil]
    def one(&block)
      return unless block_given?
      instance_eval(&block)
      @action.call('describe.one', @checks, nil)
    end

    def describe(*args, &block)
      @checks.push(['describe', args, block])
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
inspec-2.1.81 lib/inspec/describe.rb
inspec-2.1.21 lib/inspec/describe.rb
inspec-2.1.10 lib/inspec/describe.rb
inspec-2.0.32 lib/inspec/describe.rb
inspec-2.0.17 lib/inspec/describe.rb
inspec-1.51.15 lib/inspec/describe.rb