mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
rubocop
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
ae44b904e1
commit
a6c47a2e39
2 changed files with 12 additions and 12 deletions
|
@ -81,11 +81,11 @@ module Vulcano
|
|||
ctx.rules.each do |rule_id, rule|
|
||||
#::Vulcano::DSL.execute_rule(rule, profile_id)
|
||||
checks = rule.instance_variable_get(:@checks)
|
||||
checks.each do |m, a, b|
|
||||
checks.each do |_, a, b|
|
||||
# resource skipping
|
||||
if !a.empty? &&
|
||||
a[0].respond_to?(:resource_skipped) &&
|
||||
!a[0].resource_skipped.nil?
|
||||
a[0].respond_to?(:resource_skipped) &&
|
||||
!a[0].resource_skipped.nil?
|
||||
example = RSpec::Core::ExampleGroup.describe(*a) do
|
||||
it a[0].resource_skipped
|
||||
end
|
||||
|
|
|
@ -18,12 +18,12 @@ class DockerTester
|
|||
end
|
||||
|
||||
def run
|
||||
puts ["Running tests:", @tests].flatten.join("\n- ")
|
||||
puts ['Running tests:', @tests].flatten.join("\n- ")
|
||||
puts ''
|
||||
# test all images
|
||||
@conf['images'].each{|n|
|
||||
@conf['images'].each do |n|
|
||||
test_image(n)
|
||||
}.all? or raise "Test failures"
|
||||
end.all? or fail 'Test failures'
|
||||
end
|
||||
|
||||
def docker_images_by_tag
|
||||
|
@ -39,9 +39,9 @@ class DockerTester
|
|||
|
||||
def tests_conf
|
||||
# get the test configuration
|
||||
conf_path = File::join(File::dirname(__FILE__), '..', '.tests.yaml')
|
||||
raise "Can't find tests config in #{conf_path}" unless File::file?(conf_path)
|
||||
conf = YAML.load(File::read(conf_path))
|
||||
conf_path = File.join(File.dirname(__FILE__), '..', '.tests.yaml')
|
||||
fail "Can't find tests config in #{conf_path}" unless File.file?(conf_path)
|
||||
YAML.load(File.read(conf_path))
|
||||
end
|
||||
|
||||
def test_container(container_id)
|
||||
|
@ -54,13 +54,13 @@ class DockerTester
|
|||
def test_image(name)
|
||||
dname = "docker-#{name}:latest"
|
||||
image = @images[dname]
|
||||
raise "Can't find docker image #{dname}" if image.nil?
|
||||
fail "Can't find docker image #{dname}" if image.nil?
|
||||
|
||||
puts "--> start docker #{name}"
|
||||
container = Docker::Container.create(
|
||||
'Cmd' => [ '/bin/bash' ],
|
||||
'Cmd' => %w{ /bin/bash },
|
||||
'Image' => image.id,
|
||||
'OpenStdin' => true,
|
||||
'OpenStdin' => true
|
||||
)
|
||||
container.start
|
||||
|
||||
|
|
Loading…
Reference in a new issue