Sha256: c67de3100c1b1a2c26ce9bebabd1db34eb372a6929aaaa0c0e906e0b262ed548

Contents?: true

Size: 1.11 KB

Versions: 9

Compression:

Stored size: 1.11 KB

Contents

describe Kubes::Compiler::Strategy::Dsl do
  let(:dsl) { described_class.new(options) }
  let(:options) { {path: fixture(resource) } }

  context "standard" do
    let(:resource) { "project/.kubes/resources/web/deployment" }
    it "run" do
      result = dsl.run
      expect(dsl.dsl_class).to eq(Kubes::Compiler::Dsl::Syntax::Deployment)
      data = YAML.load(result.content)
      expect(data['kind']).to eq "Deployment"
    end
  end

  context "blocks" do
    let(:resource) { "blocks/deployments" }
    it "run" do
      result = dsl.run
      expect(dsl.dsl_class).to eq(Kubes::Compiler::Dsl::Core::Blocks)
      resource = result.content.split('---').last
      data = YAML.load(resource)
      expect(data['kind']).to eq "Deployment"
      expect(data['metadata']['name']).to eq "demo-web-2"
    end
  end

  context "multiple files" do
    let(:resource) { "multiple-files/.kubes/resources/web/deployment-1" }
    it "run" do
      result = dsl.run
      expect(dsl.dsl_class).to eq(Kubes::Compiler::Dsl::Syntax::Deployment)
      data = YAML.load(result.content)
      expect(data['kind']).to eq "Deployment"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kubes-0.6.8 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.7 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.6 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.5 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.4 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.3 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.2 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.1 spec/kubes/compiler/strategy/dsl_spec.rb
kubes-0.6.0 spec/kubes/compiler/strategy/dsl_spec.rb