rspec-terraform 0.1.0.pre.13 → 0.1.0.pre.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/rspec/terraform/matchers/include_resource_change.rb +30 -8
- data/lib/rspec/terraform/version.rb +1 -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: 91f52906b222af912b150dfe8adeccfcf2a96c6397a925b16e010fe95fdedc7f
|
4
|
+
data.tar.gz: 5f8339be7af3ef1e8734e4eb20114f9da5a92a7bf01d12ccc8b25c29918b39fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fc145bf6e79e9a925ede3dee1f01ff0e9d8f645da18edad9ba825d31788cb663cd018b181ea4b2a18c19051690cb4354e6267e0b6775cd06215d400c744303b
|
7
|
+
data.tar.gz: 5593bf9db223bce19a841beb644043b6d9395bb37102aa0e56a39bb7e6b7dd64c36aa6ab1e9f3e2e41c16a3027c46486e78bded63954027dddfd9fda09c950ee
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rspec-terraform (0.1.0.pre.
|
4
|
+
rspec-terraform (0.1.0.pre.14)
|
5
5
|
rspec (>= 3.0)
|
6
6
|
ruby-terraform (= 1.7.0.pre.9)
|
7
7
|
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
diff-lcs (1.5.0)
|
22
22
|
docile (1.4.0)
|
23
23
|
excon (0.92.4)
|
24
|
-
faker (2.
|
24
|
+
faker (2.22.0)
|
25
25
|
i18n (>= 1.8.11, < 2)
|
26
26
|
faraday (2.3.0)
|
27
27
|
faraday-net_http (~> 2.0)
|
@@ -142,4 +142,4 @@ DEPENDENCIES
|
|
142
142
|
simplecov
|
143
143
|
|
144
144
|
BUNDLED WITH
|
145
|
-
2.3.
|
145
|
+
2.3.19
|
@@ -138,16 +138,26 @@ module RSpec
|
|
138
138
|
"a plan including #{amount} matching " \
|
139
139
|
"resource change#{plurality}."
|
140
140
|
|
141
|
-
|
142
|
-
got_line
|
143
|
-
|
144
|
-
|
145
|
-
|
141
|
+
with_available_resource_changes(
|
142
|
+
maybe_with_relevant_resource_changes(got_line)
|
143
|
+
)
|
144
|
+
end
|
145
|
+
end
|
146
146
|
|
147
|
-
|
148
|
-
|
147
|
+
def with_available_resource_changes(got_line)
|
148
|
+
"#{got_line}\n available resource changes are:" \
|
149
|
+
"\n#{available_resource_change_lines}"
|
150
|
+
end
|
151
|
+
|
152
|
+
def maybe_with_relevant_resource_changes(got_line)
|
153
|
+
unless attributes.empty?
|
154
|
+
got_line =
|
155
|
+
"#{got_line}\n relevant resource changes are:" \
|
156
|
+
"\n#{relevant_resource_change_lines}"
|
149
157
|
end
|
158
|
+
got_line
|
150
159
|
end
|
160
|
+
|
151
161
|
# rubocop:enable Metrics/MethodLength
|
152
162
|
|
153
163
|
def cardinality_fragment
|
@@ -185,7 +195,9 @@ module RSpec
|
|
185
195
|
def expected_attribute_lines
|
186
196
|
paths = attributes.collect { |attribute| attribute[:path] }
|
187
197
|
path_set = RubyTerraform::Models::PathSet.new(paths)
|
188
|
-
values = attributes.collect
|
198
|
+
values = attributes.collect do |attribute|
|
199
|
+
with_matcher_renderable(attribute[:value])
|
200
|
+
end
|
189
201
|
object = RubyTerraform::Models::Objects.object(path_set, values)
|
190
202
|
object.render(level: 6, bare: true)
|
191
203
|
end
|
@@ -210,6 +222,16 @@ module RSpec
|
|
210
222
|
end
|
211
223
|
available_lines.join("\n")
|
212
224
|
end
|
225
|
+
|
226
|
+
def with_matcher_renderable(value)
|
227
|
+
return value if value.respond_to?(:render)
|
228
|
+
|
229
|
+
value.define_singleton_method(:render) do |_|
|
230
|
+
"a value satisfying: #{value.description}"
|
231
|
+
end
|
232
|
+
|
233
|
+
value
|
234
|
+
end
|
213
235
|
end
|
214
236
|
|
215
237
|
# rubocop:enable Metrics/ClassLength
|
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.14
|
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-07-
|
11
|
+
date: 2022-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|