Sha256: 2ef39d0e18a823220e207bb67efbbf3b9fb98ab9b9b4a514e0091ab9926a7239

Contents?: true

Size: 1.22 KB

Versions: 26

Compression:

Stored size: 1.22 KB

Contents

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

  context "standard" do
    let(:resource) { "project/.kubes/resources/web/deployment" }
    it "run" do
      result = dispatcher.dispatch
      expect(dispatcher.dsl_class(path)).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 = dispatcher.dispatch
      expect(dispatcher.dsl_class(path)).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 = dispatcher.dispatch
      expect(dispatcher.dsl_class(path)).to eq(Kubes::Compiler::Dsl::Syntax::Deployment)
      data = YAML.load(result.content)
      expect(data['kind']).to eq "Deployment"
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
kubes-0.9.3 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.9.2 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.9.1 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.9.0 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.10 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.9 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.8 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.7 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.6 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.5 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.4 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.3 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.2 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.1 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.8.0 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.7.10 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.7.9 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.7.8 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.7.7 spec/kubes/compiler/strategy/dispatcher_spec.rb
kubes-0.7.6 spec/kubes/compiler/strategy/dispatcher_spec.rb