From a6c47a2e393e55c346c0b3b527f24cfe5ad4710c Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Tue, 8 Sep 2015 14:25:24 +0200 Subject: [PATCH] rubocop Signed-off-by: Dominik Richter --- lib/vulcano/runner.rb | 6 +++--- test/docker.rb | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/vulcano/runner.rb b/lib/vulcano/runner.rb index 06217a5a9..8efea0ae0 100644 --- a/lib/vulcano/runner.rb +++ b/lib/vulcano/runner.rb @@ -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 diff --git a/test/docker.rb b/test/docker.rb index e9090c695..c41728769 100644 --- a/test/docker.rb +++ b/test/docker.rb @@ -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