lib/fulmar/domain/service/config_test_service.rb in fulmar-2.0.1 vs lib/fulmar/domain/service/config_test_service.rb in fulmar-2.0.2

- old
+ new

@@ -1,6 +1,7 @@ require 'erb' +require 'fulmar/domain/service/plugin_service' module Fulmar module Domain module Service # Tests the configuration @@ -32,12 +33,10 @@ @tests[name] = block end # Runs all methods beginning with test_ and returns the report def run - test_dirs = ["#{File.dirname(__FILE__)}/config_tests/"] - test_files = test_dirs.collect{ |dir| Dir.glob("#{dir}/*.rb") }.flatten test_files.each do |file| eval File.read(file) end results = [] @@ -52,9 +51,16 @@ protected def ssh_hostnames @ssh_hostnames ||= `grep -E '^Host [^ *]+$' ~/.ssh/config | sort | uniq | cut -d ' ' -f 2`.split("\n") + end + + def test_files + dir = "#{File.dirname(__FILE__)}/config_tests/" + files = Dir.glob("#{dir}/*.rb") + plugin_service = Fulmar::Domain::Service::PluginService.instance + files + plugin_service.test_files end end end end end