rspec-terraform 0.1.0.pre.33 → 0.1.0.pre.34
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/helpers/apply.rb +2 -2
- data/lib/rspec/terraform/helpers/destroy.rb +2 -2
- data/lib/rspec/terraform/helpers/output.rb +2 -2
- data/lib/rspec/terraform/helpers/plan.rb +2 -2
- data/lib/rspec/terraform/helpers.rb +41 -0
- data/lib/rspec/terraform/version.rb +1 -1
- data/lib/rspec/terraform.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de609f31b1c8beb997d49dfcc1424e2d2bdbd6c47f7948f6df09537229c861c5
|
4
|
+
data.tar.gz: 983c18c0cc01ebfcfeeb1c77a45bec4efa35f61620ddd45b37e6beae45af363b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 414ff88f26a5e8b1a3aa558d22eb145e61dadfb4a2b12780324187271e6e793be6532974e598df25e3722a7bec15371386f58c2e002a6e9dcd47efba13d69ff8
|
7
|
+
data.tar.gz: '0871db83e6adc06c8d4d9cb48bfb06ef03a81362f23790a032c59dc216473c4b1cd0eebb855a555b8f2cb86fe010d4a7e3ba2511d04227bc880a2d979f04b9d1'
|
data/Gemfile.lock
CHANGED
@@ -15,8 +15,8 @@ module RSpec
|
|
15
15
|
def initialize(opts = {})
|
16
16
|
@configuration_provider =
|
17
17
|
opts[:configuration_provider] || Configuration.identity_provider
|
18
|
-
@binary =
|
19
|
-
@execution_mode =
|
18
|
+
@binary = opts[:binary] || 'terraform'
|
19
|
+
@execution_mode = opts[:execution_mode] || :in_place
|
20
20
|
end
|
21
21
|
|
22
22
|
def execute(overrides = {}, &block)
|
@@ -15,8 +15,8 @@ module RSpec
|
|
15
15
|
def initialize(opts = {})
|
16
16
|
@configuration_provider =
|
17
17
|
opts[:configuration_provider] || Configuration.identity_provider
|
18
|
-
@binary =
|
19
|
-
@execution_mode =
|
18
|
+
@binary = opts[:binary] || 'terraform'
|
19
|
+
@execution_mode = opts[:execution_mode] || :in_place
|
20
20
|
end
|
21
21
|
|
22
22
|
def execute(overrides = {}, &block)
|
@@ -13,8 +13,8 @@ module RSpec
|
|
13
13
|
def initialize(opts = {})
|
14
14
|
@configuration_provider =
|
15
15
|
opts[:configuration_provider] || Configuration.identity_provider
|
16
|
-
@binary =
|
17
|
-
@execution_mode =
|
16
|
+
@binary = opts[:binary] || 'terraform'
|
17
|
+
@execution_mode = opts[:execution_mode] || :in_place
|
18
18
|
end
|
19
19
|
|
20
20
|
def execute(overrides = {})
|
@@ -18,8 +18,8 @@ module RSpec
|
|
18
18
|
def initialize(opts = {})
|
19
19
|
@configuration_provider =
|
20
20
|
opts[:configuration_provider] || Configuration.identity_provider
|
21
|
-
@binary =
|
22
|
-
@execution_mode =
|
21
|
+
@binary = opts[:binary] || 'terraform'
|
22
|
+
@execution_mode = opts[:execution_mode] || :in_place
|
23
23
|
end
|
24
24
|
|
25
25
|
def execute(overrides = {}, &block)
|
@@ -9,6 +9,47 @@ require_relative './helpers/var'
|
|
9
9
|
module RSpec
|
10
10
|
module Terraform
|
11
11
|
module Helpers
|
12
|
+
def apply(overrides = {}, &block)
|
13
|
+
RSpec::Terraform::Helpers::Apply
|
14
|
+
.new(helper_options)
|
15
|
+
.execute(overrides, &block)
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy(overrides = {}, &block)
|
19
|
+
RSpec::Terraform::Helpers::Destroy
|
20
|
+
.new(helper_options)
|
21
|
+
.execute(overrides, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
def output(overrides = {}, &block)
|
25
|
+
RSpec::Terraform::Helpers::Output
|
26
|
+
.new(helper_options)
|
27
|
+
.execute(overrides, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def plan(overrides = {}, &block)
|
31
|
+
RSpec::Terraform::Helpers::Plan
|
32
|
+
.new(helper_options)
|
33
|
+
.execute(overrides, &block)
|
34
|
+
end
|
35
|
+
|
36
|
+
def var(overrides = {}, &block)
|
37
|
+
RSpec::Terraform::Helpers::Var
|
38
|
+
.new(helper_options)
|
39
|
+
.execute(overrides, &block)
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def helper_options
|
45
|
+
config = RSpec.configuration
|
46
|
+
|
47
|
+
{
|
48
|
+
binary: config.terraform_binary,
|
49
|
+
execution_mode: config.terraform_execution_mode,
|
50
|
+
configuration_provider: config.terraform_configuration_provider
|
51
|
+
}
|
52
|
+
end
|
12
53
|
end
|
13
54
|
end
|
14
55
|
end
|
data/lib/rspec/terraform.rb
CHANGED
@@ -11,7 +11,6 @@ require_relative 'terraform/helpers'
|
|
11
11
|
# TODO
|
12
12
|
# ====
|
13
13
|
#
|
14
|
-
# * Helper functions
|
15
14
|
# * Logging
|
16
15
|
# * Test session
|
17
16
|
# * Before support in matchers
|
@@ -21,7 +20,12 @@ require_relative 'terraform/helpers'
|
|
21
20
|
|
22
21
|
RSpec.configure do |config|
|
23
22
|
config.include(RSpec::Terraform::Matchers)
|
23
|
+
config.include(RSpec::Terraform::Helpers)
|
24
24
|
|
25
25
|
config.add_setting(:terraform_binary, default: 'terraform')
|
26
26
|
config.add_setting(:terraform_execution_mode, default: :in_place)
|
27
|
+
config.add_setting(
|
28
|
+
:terraform_configuration_provider,
|
29
|
+
default: RSpec::Terraform::Configuration.identity_provider
|
30
|
+
)
|
27
31
|
end
|
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.34
|
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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: confidante
|