Sha256: b72f76e690ac6145e70af03c595f9818b26df01c22dc10bd50fefa0e7c76c0f2

Contents?: true

Size: 789 Bytes

Versions: 104

Compression:

Stored size: 789 Bytes

Contents

module Terraspace::CLI::New::Source
  class Test < Core
    # different interface than Source::Plugin
    #
    #     template: base, hcl, ruby
    #     type: module, project, stack
    #
    def set_source_paths(template, type)
      if @options[:examples]
        set_plugin_gem_source("test", type)
      else
        set_test_framework_gem_source(type) # tester gem like rspec-terraspace has empty starter templates
      end
    end

    def set_test_framework_gem_source(type)
      test_gem_name = "rspec/terraspace"

      require_gem(test_gem_name)
      tester = Terraspace::Tester.find_with(framework: Terraspace.config.test_framework)

      template_path = File.expand_path("#{tester.root}/lib/templates/#{type}")
      override_source_paths(template_path)
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
terraspace-2.2.17 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.16 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.15 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.14 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.13 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.12 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.11 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.10 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.9 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.8 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.7 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.6 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.5 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.4 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.3 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.2 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.1 lib/terraspace/cli/new/source/test.rb
terraspace-2.2.0 lib/terraspace/cli/new/source/test.rb
terraspace-2.1.7 lib/terraspace/cli/new/source/test.rb
terraspace-2.1.6 lib/terraspace/cli/new/source/test.rb