Sha256: 9d7ee53d2fa7612e62239426a9436e1a65df682c18820b69f7893bd7c34ed6ab

Contents?: true

Size: 828 Bytes

Versions: 89

Compression:

Stored size: 828 Bytes

Contents

describe Terraspace::Hooks::Builder do
  let(:builder) do
    builder = described_class.new(mod, dsl_file, name)
    builder
  end
  let(:mod) do
    mod = double(:mod).as_null_object
    allow(mod).to receive(:cache_dir).and_return("/tmp")
    mod
  end

  context "single" do
    let(:dsl_file) { fixture("terraform/hooks/single.rb") }
    let(:name) { "apply" }
    it "build creates the @hooks structure" do
      hooks = builder.build
      expect(hooks.keys).to include("before")
    end

    it "run_hooks" do
      builder.build
      builder.run_hooks
    end
  end

  context "multiple" do
    let(:dsl_file) { fixture("terraform/hooks/multiple.rb") }
    let(:name) { "apply" }
    it "build creates the @hooks structure" do
      hooks = builder.build
      expect(hooks.keys).to include("before")
    end
  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
terraspace-2.1.5 spec/terraspace/hooks/builder_spec.rb
terraspace-2.1.4 spec/terraspace/hooks/builder_spec.rb
terraspace-2.1.3 spec/terraspace/hooks/builder_spec.rb
terraspace-2.1.2 spec/terraspace/hooks/builder_spec.rb
terraspace-2.1.1 spec/terraspace/hooks/builder_spec.rb
terraspace-2.1.0 spec/terraspace/hooks/builder_spec.rb
terraspace-2.0.3 spec/terraspace/hooks/builder_spec.rb
terraspace-2.0.2 spec/terraspace/hooks/builder_spec.rb
terraspace-2.0.1 spec/terraspace/hooks/builder_spec.rb
terraspace-2.0.0 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.7 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.6 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.5 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.4 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.3 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.2 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.1 spec/terraspace/hooks/builder_spec.rb
terraspace-1.1.0 spec/terraspace/hooks/builder_spec.rb
terraspace-1.0.6 spec/terraspace/hooks/builder_spec.rb
terraspace-1.0.5 spec/terraspace/hooks/builder_spec.rb