test/util/generator_helpers.rb in beaker-hostgenerator-0.5.0 vs test/util/generator_helpers.rb in beaker-hostgenerator-0.6.0

- old
+ new

@@ -1,14 +1,12 @@ require "yaml" require 'beaker-hostgenerator' -require 'beaker-hostgenerator/data/vmpooler' require 'beaker-hostgenerator/data' module GeneratorTestHelpers include BeakerHostGenerator::Data - include BeakerHostGenerator::Data::Vmpooler def run_cli_with_options(options=[]) STDERR.reopen("stderr.txt", "w") cli = BeakerHostGenerator::CLI.new(options) yaml_string = cli.execute @@ -53,12 +51,12 @@ def generate_fixtures_using_osinfo(relative_path, role_enumerator, options=[], bhg_version=0) - osinfo = get_osinfo(bhg_version) - osinfo.each_key do |platform_info| + platforms = get_platforms(bhg_version) + platforms.each do |platform_info| role = role_enumerator.next spec = "#{platform_info}" + role generate_fixture(relative_path, options, spec) end end @@ -143,8 +141,18 @@ } ].each do |fixture_info| generate_fixture(fixture_info['path'], fixture_info['options'], fixture_info['spec']) + end + + # Validates multi-platform specs + get_platforms(0).zip( + get_platforms(1).reverse, + get_platforms(0), + @simple_roles.cycle, + @simple_roles.reverse.cycle + ) do |p1, p2, p3, r1, r2| + generate_fixture(["multiplatform"], [], "#{p1}#{r1}-#{p2}-#{p3}#{r2}") end end end