Sha256: 55b9430c47b4a037b5789fad470e0db3e34ae4a1f36fcbf295655bf95c6e0559

Contents?: true

Size: 895 Bytes

Versions: 12

Compression:

Stored size: 895 Bytes

Contents

describe Terraspace::Terraform::Hooks::Builder do
  let(:builder) do
    builder = described_class.new(mod, name)
    builder.instance_variable_set(:@file, file) # override @file for spec
    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(: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(: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

12 entries across 12 versions & 1 rubygems

Version Path
terraspace-0.3.6 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.3.5 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.3.4 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.3.3 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.3.2 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.3.1 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.3.0 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.2.4 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.2.3 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.2.2 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.2.1 spec/terraspace/terraform/hooks/builder_spec.rb
terraspace-0.2.0 spec/terraspace/terraform/hooks/builder_spec.rb