improvement: simplify runner configuration

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-18 16:56:31 +02:00
parent 29e2ea9fd1
commit 9de015ae2d
3 changed files with 4 additions and 4 deletions

View file

@ -71,7 +71,7 @@ class VulcanoCLI < Thor
desc: 'Configure WinRM scans to run via SSL instead of pure HTTP.'
option :format, type: :string, default: 'progress'
def exec(*tests)
runner = Vulcano::Runner.new(options[:id], options)
runner = Vulcano::Runner.new(options)
runner.add_tests(tests)
runner.run
rescue RuntimeError => e

View file

@ -14,9 +14,9 @@ require 'vulcano/rspec_json_formatter'
module Vulcano
class Runner
attr_reader :tests
def initialize(profile_id, conf)
def initialize(conf = {})
@rules = []
@profile_id = profile_id
@profile_id = @conf[:id]
@conf = Vulcano::Backend.target_config(normalize_map(conf))
@tests = RSpec::Core::World.new

View file

@ -77,7 +77,7 @@ class DockerTester
def test_container(container, report)
puts "--> run test on docker #{container.id}"
opts = { 'target' => "docker://#{container.id}" }
runner = Vulcano::Runner.new(nil, opts)
runner = Vulcano::Runner.new(opts)
runner.add_tests(@tests)
tests = runner.tests.ordered_example_groups
tests.map { |g| g.run(report) }