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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7dea956c8c5abc31548bcb8f4eaa21fd8e16525bf4c42e0781642d97727f75ca
4
- data.tar.gz: bb4a391fd05d49ba05358601d23b7009d2ebdff65c2f6d74c3a2f3dbfc60d6f1
3
+ metadata.gz: de609f31b1c8beb997d49dfcc1424e2d2bdbd6c47f7948f6df09537229c861c5
4
+ data.tar.gz: 983c18c0cc01ebfcfeeb1c77a45bec4efa35f61620ddd45b37e6beae45af363b
5
5
  SHA512:
6
- metadata.gz: '04383fb4bdd8db184a3b6eed0bee9e60c505dcc8c5d019a65b2d605c12be2fa4f704da2f9a0f0e09759c0c68810df28ea01832045283a24ba0a131cb300ba9e7'
7
- data.tar.gz: 50e0c7064dd23172e417773b4f3bd0d9017e1517d8128a26b76304b929604d0a6d41493b2cf38a444fd9a9ee5d8febdc3c310907a18beb60ae59a179f9a6df5b
6
+ metadata.gz: 414ff88f26a5e8b1a3aa558d22eb145e61dadfb4a2b12780324187271e6e793be6532974e598df25e3722a7bec15371386f58c2e002a6e9dcd47efba13d69ff8
7
+ data.tar.gz: '0871db83e6adc06c8d4d9cb48bfb06ef03a81362f23790a032c59dc216473c4b1cd0eebb855a555b8f2cb86fe010d4a7e3ba2511d04227bc880a2d979f04b9d1'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-terraform (0.1.0.pre.33)
4
+ rspec-terraform (0.1.0.pre.34)
5
5
  confidante (>= 0.27)
6
6
  rspec (>= 3.0)
7
7
  ruby-terraform (= 1.7.0.pre.15)
@@ -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 = RSpec.configuration.terraform_binary
19
- @execution_mode = RSpec.configuration.terraform_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 = RSpec.configuration.terraform_binary
19
- @execution_mode = RSpec.configuration.terraform_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 = RSpec.configuration.terraform_binary
17
- @execution_mode = RSpec.configuration.terraform_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 = RSpec.configuration.terraform_binary
22
- @execution_mode = RSpec.configuration.terraform_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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Terraform
5
- VERSION = '0.1.0.pre.33'
5
+ VERSION = '0.1.0.pre.34'
6
6
  end
7
7
  end
@@ -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.33
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-28 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: confidante