Sha256: d92b32959be5fdca743700c19c6bed650ceaea4b8929851d15287c2d4ad2c83c

Contents?: true

Size: 1.13 KB

Versions: 51

Compression:

Stored size: 1.13 KB

Contents

describe Terraspace::Seeder::Content do
  let(:content) { described_class.new(parsed) }

  context "basic examples" do
    let(:parsed) do
      {
        "variable"=>{
          "project"=>{"default"=>"project-name"},
          "name"=>{"type"=>"string"},
        }
      }
    end

    it "required_vars" do
      result = content.required_vars
      expect(result).to eq({"name"=>{"type"=>"string"}})
    end

    it "optional_vars" do
      result = content.optional_vars
      expect(result).to eq({"project"=>{"default"=>"project-name"}})
    end
  end

  context "description examples" do
    let(:parsed) do
      {
        "variable"=>{
          "project"=>{"default"=>"project-name", "description"=>"project name. IE: my-project"},
          "name"=>{"type"=>"string"},
          "azs"=>{"type"=>"list(string)"},
        }
      }
    end

    it "build" do
      result = content.build
      expected =<<~EOL
        # Required variables:
        name      = "string"
        azs       = [...] # list(string)

        # Optional variables:
        # project = "project-name"
      EOL
      expect(result).to eq(expected)
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
terraspace-2.2.17 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.16 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.15 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.14 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.13 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.12 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.11 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.10 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.9 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.8 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.7 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.6 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.5 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.4 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.3 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.2 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.1 spec/terraspace/seeder/content_spec.rb
terraspace-2.2.0 spec/terraspace/seeder/content_spec.rb
terraspace-2.1.7 spec/terraspace/seeder/content_spec.rb
terraspace-2.1.6 spec/terraspace/seeder/content_spec.rb