rspec-terraform 0.1.0.pre.37 → 0.1.0.pre.38

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: f5d0cfbad94632db8e93fd7d1747f84d6c1b41f2210e97108a0809685ebe248f
4
- data.tar.gz: 1fda168e5e4bf24e8d9c6a89bc602974b3a865e94a22cf2bef7421c96e980d43
3
+ metadata.gz: e3e05eb03fa7646e942de57b9dace527769ff3f82d29a8558e296c633e4781f5
4
+ data.tar.gz: a48852eace306d90abed4dceae0b3ae6967fde6206c884817690f78161a11f70
5
5
  SHA512:
6
- metadata.gz: e35006b4b7834783ae18eeded06ef9bd29d52322718ab51c9cb7c09403d28e83e69cc7835bb63a75a565dac10094eb89b4602aaf77e2a1b925953fe17daf504d
7
- data.tar.gz: 1fff5187933552ed362c84114470adadb9cab8799420df6b3ce6a945d9cda5d1d614fec5dec6a672675a6e98a2de83fbeb2f75caf6861f2434b0da324dd732f4
6
+ metadata.gz: 3e9bfbef08d1a36d6484543bc98e63ca2a1dbea26787c4460798aa0bd03a0155d5d68e077b357467d56c2e9f15ee7913df44c879f397375afa4eb6df1e9fb836
7
+ data.tar.gz: 9e1d4703dcd59209d1141da61361a5503021416a11c29d772777d97b8bca316ef73282cefb1db1b8a4f8e990c69b0fb39602946f79d5df51dd134d6650ffed68
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-terraform (0.1.0.pre.37)
4
+ rspec-terraform (0.1.0.pre.38)
5
5
  confidante (>= 0.27)
6
6
  rspec (>= 3.0)
7
7
  ruby-terraform (= 1.7.0.pre.16)
@@ -32,10 +32,8 @@ module RSpec
32
32
  init(parameters)
33
33
  plan_file = plan(parameters)
34
34
  plan_contents = show(parameters, plan_file)
35
-
36
- RubyTerraform::Models::Plan.new(
37
- JSON.parse(plan_contents, symbolize_names: true)
38
- )
35
+ remove(parameters, plan_file)
36
+ parse(plan_contents)
39
37
  end
40
38
 
41
39
  private
@@ -105,6 +103,18 @@ module RSpec
105
103
  stdout.string
106
104
  end
107
105
 
106
+ def parse(plan_contents)
107
+ RubyTerraform::Models::Plan.new(
108
+ JSON.parse(plan_contents, symbolize_names: true)
109
+ )
110
+ end
111
+
112
+ def remove(parameters, plan_file)
113
+ FileUtils.rm_f(
114
+ File.join(parameters[:configuration_directory], plan_file)
115
+ )
116
+ end
117
+
108
118
  def init_command
109
119
  RubyTerraform::Commands::Init.new(binary: binary)
110
120
  end
@@ -135,7 +145,8 @@ module RSpec
135
145
  plan_parameters =
136
146
  parameters.merge(
137
147
  chdir: parameters[:configuration_directory],
138
- out: parameters[:plan_file_name] || SecureRandom.hex(10),
148
+ out: parameters[:plan_file_name] ||
149
+ "#{SecureRandom.hex[0, 10]}.tfplan",
139
150
  input: false
140
151
  )
141
152
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Terraform
5
- VERSION = '0.1.0.pre.37'
5
+ VERSION = '0.1.0.pre.38'
6
6
  end
7
7
  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.37
4
+ version: 0.1.0.pre.38
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-30 00:00:00.000000000 Z
11
+ date: 2022-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: confidante