lib/gondola/suiterunner.rb
# Function to read any config files which contain data for this
# test case or suite
Function to read any config files which contain data for this
test case or suite
Function to read any config files which contain data for this test case or suite
def config_from_file(file, api=true)
      unless File.directory? file
        return config_from_file(File.expand_path(File.dirname(file)))
      end
      conf = {}
      Dir.chdir(file) do
        if api
          if File.exists? "ondemand.yml"
            conf.merge! YAML.load_file("ondemand.yml")
            api = false
          end
        end
        conf.merge! YAML.load_file("config.yml") if File.exists? "config.yml"
      end
      unless file == File.dirname(file)
        return config_from_file(File.expand_path(File.dirname(file)), api).merge(conf)
      end
      return conf
    end
def config_from_file ( file , api = true ) unless File . directory? file return config_from_file ( File . expand_path ( File . dirname ( file ) ) ) end conf = { } Dir . chdir ( file ) do if api if File . exists? "ondemand.yml" conf . merge! YAML . load_file ( "ondemand.yml" ) api = false end end conf . merge! YAML . load_file ( "config.yml" ) if File . exists? "config.yml" end unless file == File . dirname ( file ) return config_from_file ( File . expand_path ( File . dirname ( file ) ) , api ) . merge ( conf ) end return conf end
Function to read any config files which contain data for this
test case or suite
Function to read any config files which contain data for this test case or suite
# If the given test is just a file then start your search in # its parent directory # Load any config files in the current directory only if # a config hasn't already been found # Recurse through the parent directories and merge the # current configuration
file
<not_specific>
api
<not_specific>