Module: Dockerspec::Builder::Matchers

Extended by:
RSpec::Matchers::DSL
Defined in:
lib/dockerspec/builder/matchers.rb,
lib/dockerspec/builder/matchers/helpers.rb

Overview

Creates some RSpec have_ matchers for Docker builds.

Defined Under Namespace

Modules: MatcherHelpers

Constant Summary collapse

PREDICATE_TYPES =

The matcher list with the type it belongs to.

This is based on the official Dockerfile parser code .

The possible types are:

  • :string: A simple string. For example the MAINTAINER instruction.
  • :json: Can in JSON (a Ruby array) or in string format. For example the CMD or the ENTRYPOINT instructions.
  • :hash: A hash. For example the ENV or the LABEL instructions.
  • :array: A array of values. For example the EXPOSE instruction.
{
  maintainer: :string,
  cmd: :json,
  label: :hash,
  expose: :array,
  env: :hash,
  entrypoint: :json,
  volume: :array,
  user: :string,
  workdir: :string,
  onbuild: :array,
  stopsignal: :string
}.freeze