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.1.5 spec/terraspace/seeder/content_spec.rb
terraspace-2.1.4 spec/terraspace/seeder/content_spec.rb
terraspace-2.1.3 spec/terraspace/seeder/content_spec.rb
terraspace-2.1.2 spec/terraspace/seeder/content_spec.rb
terraspace-2.1.1 spec/terraspace/seeder/content_spec.rb
terraspace-2.1.0 spec/terraspace/seeder/content_spec.rb
terraspace-2.0.3 spec/terraspace/seeder/content_spec.rb
terraspace-2.0.2 spec/terraspace/seeder/content_spec.rb
terraspace-2.0.1 spec/terraspace/seeder/content_spec.rb
terraspace-2.0.0 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.7 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.6 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.5 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.4 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.3 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.2 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.1 spec/terraspace/seeder/content_spec.rb
terraspace-1.1.0 spec/terraspace/seeder/content_spec.rb
terraspace-1.0.6 spec/terraspace/seeder/content_spec.rb
terraspace-1.0.5 spec/terraspace/seeder/content_spec.rb