Sha256: ce07b035ff43dc48f9b96f3154992f16c41d2650e9ba601d7c4f3506c8c2a0db

Contents?: true

Size: 587 Bytes

Versions: 8

Compression:

Stored size: 587 Bytes

Contents

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

8 entries across 8 versions & 2 rubygems

Version Path
inspec-core-4.7.3 lib/inspec/describe.rb
inspec-4.7.3 lib/inspec/describe.rb
inspec-core-4.6.9 lib/inspec/describe.rb
inspec-4.6.9 lib/inspec/describe.rb
inspec-core-4.6.4 lib/inspec/describe.rb
inspec-4.6.4 lib/inspec/describe.rb
inspec-core-4.6.3 lib/inspec/describe.rb
inspec-4.6.3 lib/inspec/describe.rb