rspec-terraform 0.1.0.pre.33 → 0.1.0.pre.36

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: dde90bef4a301ed3039f8dd05483f9a1719e0a242f6b322df14075301e1bbbf1
4
+ data.tar.gz: 7d2608383fc8cf88398b3ba89cec45879c9c4631869026febcf22604f6665fcf
5
5
  SHA512:
6
- metadata.gz: '04383fb4bdd8db184a3b6eed0bee9e60c505dcc8c5d019a65b2d605c12be2fa4f704da2f9a0f0e09759c0c68810df28ea01832045283a24ba0a131cb300ba9e7'
7
- data.tar.gz: 50e0c7064dd23172e417773b4f3bd0d9017e1517d8128a26b76304b929604d0a6d41493b2cf38a444fd9a9ee5d8febdc3c310907a18beb60ae59a179f9a6df5b
6
+ metadata.gz: b598fdbc496757b7ae6280a5ed07d27f37ebd6077f26b640cf49ddf2ecb711376ed3da081b98b96e2e374dab98d7c57e179d31798c6931633a525022737dbe64
7
+ data.tar.gz: 85ceeb2799d89e0d73a2949fe3aeaf19a1c22b0810133371bd628aa54d09eb1b9ebd49a8c843f51c9ad24b04baac7062e35c49c13727747825ee2dfb626b8a19
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-terraform (0.1.0.pre.33)
4
+ rspec-terraform (0.1.0.pre.36)
5
5
  confidante (>= 0.27)
6
6
  rspec (>= 3.0)
7
- ruby-terraform (= 1.7.0.pre.15)
7
+ ruby-terraform (= 1.7.0.pre.16)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -113,7 +113,7 @@ GEM
113
113
  colored2 (~> 3.1)
114
114
  rake_factory (~> 0.23)
115
115
  sshkey (~> 2.0)
116
- rb-fsevent (0.11.1)
116
+ rb-fsevent (0.11.2)
117
117
  rb-inotify (0.10.1)
118
118
  ffi (~> 1.0)
119
119
  regexp_parser (2.5.0)
@@ -148,7 +148,7 @@ GEM
148
148
  rubocop-rspec (2.12.1)
149
149
  rubocop (~> 1.31)
150
150
  ruby-progressbar (1.11.0)
151
- ruby-terraform (1.7.0.pre.15)
151
+ ruby-terraform (1.7.0.pre.16)
152
152
  immutable-struct (~> 2.4)
153
153
  lino (~> 3.0)
154
154
  ruby2_keywords (0.0.5)
@@ -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
@@ -108,7 +108,7 @@ module RSpec
108
108
  def expected_value_lines
109
109
  renderable_value = with_matcher_renderable(value)
110
110
  value_object =
111
- RubyTerraform::Models::Values.map(value: renderable_value)
111
+ RubyTerraform::Models::Values.map({ value: renderable_value })
112
112
  value_object.render(level: 6, bare: true)
113
113
  end
114
114
 
@@ -153,7 +153,7 @@ module RSpec
153
153
  actions = oc.change.actions.join(', ')
154
154
  value = oc.change.after_object
155
155
  value_object =
156
- RubyTerraform::Models::Values.map(value: value)
156
+ RubyTerraform::Models::Values.map({ value: value })
157
157
  value_lines = value_object.render(level: 8, bare: true)
158
158
 
159
159
  " - #{name} (#{actions})\n#{value_lines}"
@@ -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.36'
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
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
39
39
 
40
40
  spec.add_dependency 'confidante', '>= 0.27'
41
41
  spec.add_dependency 'rspec', '>= 3.0'
42
- spec.add_dependency 'ruby-terraform', '1.7.0.pre.15'
42
+ spec.add_dependency 'ruby-terraform', '1.7.0.pre.16'
43
43
 
44
44
  spec.add_development_dependency 'bundler'
45
45
  spec.add_development_dependency 'faker'
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.36
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
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.7.0.pre.15
47
+ version: 1.7.0.pre.16
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.7.0.pre.15
54
+ version: 1.7.0.pre.16
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement