inspec/test/unit/resources/docker_image_test.rb
Christoph Hartmann 218bda9c34 Docker resource (#1566)
* add docker, docker_container, and docker_image resources

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-04-24 10:47:03 -04:00

22 lines
694 B
Ruby

# encoding: utf-8
# author: Christoph Hartmann
require 'helper'
require 'inspec/resource'
describe 'Inspec::Resources::DockerImage' do
describe 'docker_image' do
it 'check docker image parsing' do
resource = load_resource('docker_image', 'alpine')
_(resource.id).must_equal 'sha256:4a415e3663882fbc554ee830889c68a33b3585503892cc718a4698e91ef2a526'
_(resource.tag).must_equal 'latest'
_(resource.image).must_equal 'alpine:latest'
_(resource.repo).must_equal 'alpine'
end
it 'prints as a docker_image resource' do
resource = load_resource('docker_image', 'alpine')
resource.to_s.must_equal 'Docker Image alpine:latest'
end
end
end