Sha256: fb4c6398b0338968a20bb6b2b302188cfecfcce69d01682677b97864e26e3efe

Contents?: true

Size: 1.03 KB

Versions: 91

Compression:

Stored size: 1.03 KB

Contents

describe Terraspace::Dependency::Helper::Output do
  let(:output) do
    described_class.new(mod, identifier, options)
  end
  let (:mod) { Terraspace::Mod.new("foo") }
  # doesnt matter for spec
  let (:identifier) { nil }
  let (:options) { nil }

  context "unresolved" do
    before(:each) { mod.resolved = false }
    it "result calls Marker::Output" do
      allow(Terraspace::Terraform::RemoteState::Marker::Output).to receive(:new).and_return(double(:marker_output).as_null_object)
      result = output.result
      expect(result).to be_a(RSpec::Mocks::Double)
      expect(result.instance_variable_get(:@name)).to eq :marker_output
    end
  end

  context "resolved" do
    before(:each) { mod.resolved = true }
    it "result calls Fetcher" do
      allow(Terraspace::Terraform::RemoteState::Fetcher).to receive(:new).and_return(double(:fetcher_output).as_null_object)
      result = output.result
      expect(result).to be_a(RSpec::Mocks::Double)
      expect(result.instance_variable_get(:@name)).to eq :fetcher_output
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
terraspace-2.2.17 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.16 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.15 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.14 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.13 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.12 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.11 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.10 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.9 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.8 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.7 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.6 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.5 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.4 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.3 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.2 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.1 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.2.0 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.1.7 spec/terraspace/dependency/helper/output_spec.rb
terraspace-2.1.6 spec/terraspace/dependency/helper/output_spec.rb