rspec-terraform 0.1.0.pre.30 → 0.1.0.pre.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rspec/terraform/configuration/providers/base.rb +1 -0
- data/lib/rspec/terraform/configuration/providers/chain.rb +32 -0
- data/lib/rspec/terraform/configuration/providers.rb +1 -0
- data/lib/rspec/terraform/configuration.rb +10 -2
- data/lib/rspec/terraform/helpers/apply.rb +4 -5
- data/lib/rspec/terraform/helpers/destroy.rb +4 -5
- data/lib/rspec/terraform/helpers/output.rb +4 -5
- data/lib/rspec/terraform/helpers/plan.rb +4 -5
- data/lib/rspec/terraform/helpers/var.rb +4 -5
- data/lib/rspec/terraform/version.rb +1 -1
- data/lib/rspec/terraform.rb +11 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dea956c8c5abc31548bcb8f4eaa21fd8e16525bf4c42e0781642d97727f75ca
|
4
|
+
data.tar.gz: bb4a391fd05d49ba05358601d23b7009d2ebdff65c2f6d74c3a2f3dbfc60d6f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '04383fb4bdd8db184a3b6eed0bee9e60c505dcc8c5d019a65b2d605c12be2fa4f704da2f9a0f0e09759c0c68810df28ea01832045283a24ba0a131cb300ba9e7'
|
7
|
+
data.tar.gz: 50e0c7064dd23172e417773b4f3bd0d9017e1517d8128a26b76304b929604d0a6d41493b2cf38a444fd9a9ee5d8febdc3c310907a18beb60ae59a179f9a6df5b
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ruby_terraform'
|
4
|
+
|
5
|
+
require_relative './base'
|
6
|
+
|
7
|
+
module RSpec
|
8
|
+
module Terraform
|
9
|
+
module Configuration
|
10
|
+
module Providers
|
11
|
+
class Chain < Base
|
12
|
+
attr_reader(:providers)
|
13
|
+
|
14
|
+
def initialize(opts = {})
|
15
|
+
super()
|
16
|
+
@providers = opts[:providers] || []
|
17
|
+
end
|
18
|
+
|
19
|
+
def resolve(overrides = {})
|
20
|
+
providers.reduce(overrides) do |acc, provider|
|
21
|
+
provider.resolve(acc)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def reset
|
26
|
+
providers.each { |provider| provider.reset }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -12,13 +12,21 @@ module RSpec
|
|
12
12
|
Providers::Identity.new
|
13
13
|
end
|
14
14
|
|
15
|
-
def in_memory_provider(opts)
|
15
|
+
def in_memory_provider(opts = {})
|
16
16
|
Providers::InMemory.new(opts)
|
17
17
|
end
|
18
18
|
|
19
|
-
def confidante_provider(opts)
|
19
|
+
def confidante_provider(opts = {})
|
20
20
|
Providers::Confidante.new(opts)
|
21
21
|
end
|
22
|
+
|
23
|
+
def seed_provider(opts = {})
|
24
|
+
Providers::Seed.new(opts)
|
25
|
+
end
|
26
|
+
|
27
|
+
def chain_provider(opts = {})
|
28
|
+
Providers::Chain.new(opts)
|
29
|
+
end
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
@@ -9,18 +9,17 @@ module RSpec
|
|
9
9
|
module Helpers
|
10
10
|
class Apply
|
11
11
|
attr_reader(
|
12
|
-
:
|
12
|
+
:configuration_provider, :binary, :execution_mode
|
13
13
|
)
|
14
14
|
|
15
|
-
def initialize(
|
16
|
-
@overrides = overrides
|
15
|
+
def initialize(opts = {})
|
17
16
|
@configuration_provider =
|
18
|
-
configuration_provider || Configuration.identity_provider
|
17
|
+
opts[:configuration_provider] || Configuration.identity_provider
|
19
18
|
@binary = RSpec.configuration.terraform_binary
|
20
19
|
@execution_mode = RSpec.configuration.terraform_execution_mode
|
21
20
|
end
|
22
21
|
|
23
|
-
def execute(&block)
|
22
|
+
def execute(overrides = {}, &block)
|
24
23
|
parameters = with_configuration_provider_parameters(overrides)
|
25
24
|
parameters = with_resolved_vars(parameters, &block)
|
26
25
|
parameters = with_mandatory_parameters(parameters)
|
@@ -9,18 +9,17 @@ module RSpec
|
|
9
9
|
module Helpers
|
10
10
|
class Destroy
|
11
11
|
attr_reader(
|
12
|
-
:
|
12
|
+
:configuration_provider, :binary, :execution_mode
|
13
13
|
)
|
14
14
|
|
15
|
-
def initialize(
|
16
|
-
@overrides = overrides
|
15
|
+
def initialize(opts = {})
|
17
16
|
@configuration_provider =
|
18
|
-
configuration_provider || Configuration.identity_provider
|
17
|
+
opts[:configuration_provider] || Configuration.identity_provider
|
19
18
|
@binary = RSpec.configuration.terraform_binary
|
20
19
|
@execution_mode = RSpec.configuration.terraform_execution_mode
|
21
20
|
end
|
22
21
|
|
23
|
-
def execute(&block)
|
22
|
+
def execute(overrides = {}, &block)
|
24
23
|
parameters = with_configuration_provider_parameters(overrides)
|
25
24
|
parameters = with_resolved_vars(parameters, &block)
|
26
25
|
|
@@ -7,18 +7,17 @@ module RSpec
|
|
7
7
|
module Helpers
|
8
8
|
class Output
|
9
9
|
attr_reader(
|
10
|
-
:
|
10
|
+
:configuration_provider, :binary, :execution_mode
|
11
11
|
)
|
12
12
|
|
13
|
-
def initialize(
|
14
|
-
@overrides = overrides
|
13
|
+
def initialize(opts = {})
|
15
14
|
@configuration_provider =
|
16
|
-
configuration_provider || Configuration.identity_provider
|
15
|
+
opts[:configuration_provider] || Configuration.identity_provider
|
17
16
|
@binary = RSpec.configuration.terraform_binary
|
18
17
|
@execution_mode = RSpec.configuration.terraform_execution_mode
|
19
18
|
end
|
20
19
|
|
21
|
-
def execute
|
20
|
+
def execute(overrides = {})
|
22
21
|
parameters = with_configuration_provider_parameters(overrides)
|
23
22
|
parameters = with_mandatory_parameters(parameters)
|
24
23
|
|
@@ -12,18 +12,17 @@ module RSpec
|
|
12
12
|
# rubocop:disable Metrics/ClassLength
|
13
13
|
class Plan
|
14
14
|
attr_reader(
|
15
|
-
:
|
15
|
+
:configuration_provider, :binary, :execution_mode
|
16
16
|
)
|
17
17
|
|
18
|
-
def initialize(
|
19
|
-
@overrides = overrides
|
18
|
+
def initialize(opts = {})
|
20
19
|
@configuration_provider =
|
21
|
-
configuration_provider || Configuration.identity_provider
|
20
|
+
opts[:configuration_provider] || Configuration.identity_provider
|
22
21
|
@binary = RSpec.configuration.terraform_binary
|
23
22
|
@execution_mode = RSpec.configuration.terraform_execution_mode
|
24
23
|
end
|
25
24
|
|
26
|
-
def execute(&block)
|
25
|
+
def execute(overrides = {}, &block)
|
27
26
|
parameters = with_configuration_provider_parameters(overrides)
|
28
27
|
parameters = with_resolved_vars(parameters, &block)
|
29
28
|
|
@@ -6,15 +6,14 @@ module RSpec
|
|
6
6
|
module Terraform
|
7
7
|
module Helpers
|
8
8
|
class Var
|
9
|
-
attr_reader(:
|
9
|
+
attr_reader(:configuration_provider)
|
10
10
|
|
11
|
-
def initialize(
|
12
|
-
@overrides = overrides
|
11
|
+
def initialize(opts = {})
|
13
12
|
@configuration_provider =
|
14
|
-
configuration_provider || Configuration.identity_provider
|
13
|
+
opts[:configuration_provider] || Configuration.identity_provider
|
15
14
|
end
|
16
15
|
|
17
|
-
def execute(&block)
|
16
|
+
def execute(overrides = {}, &block)
|
18
17
|
parameters = with_configuration_provider_parameters(overrides)
|
19
18
|
parameters = with_resolved_vars(parameters, &block)
|
20
19
|
|
data/lib/rspec/terraform.rb
CHANGED
@@ -8,6 +8,17 @@ require_relative 'terraform/configuration'
|
|
8
8
|
require_relative 'terraform/matchers'
|
9
9
|
require_relative 'terraform/helpers'
|
10
10
|
|
11
|
+
# TODO
|
12
|
+
# ====
|
13
|
+
#
|
14
|
+
# * Helper functions
|
15
|
+
# * Logging
|
16
|
+
# * Test session
|
17
|
+
# * Before support in matchers
|
18
|
+
# * Reference support in matchers
|
19
|
+
# * Sensitive support in matchers
|
20
|
+
#
|
21
|
+
|
11
22
|
RSpec.configure do |config|
|
12
23
|
config.include(RSpec::Terraform::Matchers)
|
13
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-terraform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.pre.
|
4
|
+
version: 0.1.0.pre.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InfraBlocks Maintainers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: confidante
|
@@ -297,6 +297,7 @@ files:
|
|
297
297
|
- lib/rspec/terraform/configuration/merger.rb
|
298
298
|
- lib/rspec/terraform/configuration/providers.rb
|
299
299
|
- lib/rspec/terraform/configuration/providers/base.rb
|
300
|
+
- lib/rspec/terraform/configuration/providers/chain.rb
|
300
301
|
- lib/rspec/terraform/configuration/providers/confidante.rb
|
301
302
|
- lib/rspec/terraform/configuration/providers/identity.rb
|
302
303
|
- lib/rspec/terraform/configuration/providers/in_memory.rb
|