Sha256: 3ecc4095e788e7b397aa4598a8e7addc04dad349c37530c00d3f4e17fe30ad4b

Contents?: true

Size: 661 Bytes

Versions: 232

Compression:

Stored size: 661 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

232 entries across 232 versions & 2 rubygems

Version Path
inspec-core-4.3.2 lib/inspec/describe.rb
inspec-4.3.2 lib/inspec/describe.rb
inspec-core-4.2.0.preview lib/inspec/describe.rb
inspec-4.2.0.preview lib/inspec/describe.rb
inspec-core-4.1.4.preview lib/inspec/describe.rb
inspec-4.1.4.preview lib/inspec/describe.rb
inspec-core-3.9.3 lib/inspec/describe.rb
inspec-3.9.3 lib/inspec/describe.rb
inspec-core-3.9.0 lib/inspec/describe.rb
inspec-3.9.0 lib/inspec/describe.rb
inspec-core-3.7.11 lib/inspec/describe.rb
inspec-3.7.11 lib/inspec/describe.rb
inspec-core-3.7.1 lib/inspec/describe.rb
inspec-3.7.1 lib/inspec/describe.rb
inspec-core-3.6.6 lib/inspec/describe.rb
inspec-3.6.6 lib/inspec/describe.rb
inspec-core-3.6.4 lib/inspec/describe.rb
inspec-3.6.4 lib/inspec/describe.rb
inspec-core-2.3.28 lib/inspec/describe.rb
inspec-2.3.28 lib/inspec/describe.rb