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.2.17 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.16 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.15 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.14 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.13 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.12 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.11 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.10 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.9 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.8 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.7 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.6 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.5 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.4 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.3 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.2 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.1 spec/terraspace/hooks/builder_spec.rb
terraspace-2.2.0 spec/terraspace/hooks/builder_spec.rb
terraspace-2.1.7 spec/terraspace/hooks/builder_spec.rb
terraspace-2.1.6 spec/terraspace/hooks/builder_spec.rb