rspec-terraform 0.1.0.pre.15 → 0.1.0.pre.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -9
- data/lib/rspec/terraform/matchers/include_output_change.rb +29 -0
- data/lib/rspec/terraform/matchers.rb +25 -0
- data/lib/rspec/terraform/version.rb +1 -1
- data/rspec-terraform.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6ac4e2b2d77dd35725d9b20272c00e2dc5169b0a7a95b6855b8922490f10c3c
|
4
|
+
data.tar.gz: aef35909c6f6fd8ac38e08361d9938dca36889a48546edaf65ffb4df1c9787a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '038f3ef462faa363b6502df52393220c9905bffaf8169a6766e93fc7842a8ff3c3c0517f038e424c098670eeea22bf72ca3d291ba26b7066942d1d061d440c35'
|
7
|
+
data.tar.gz: d0eaae468c9796b7e76e4607229901ffbc538be736da7934c20305e118d522874df8f3bb65d7a1e7123adf297f040d1b37265dfa5098a8c1c753e1cbe93e9e9b
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rspec-terraform (0.1.0.pre.
|
4
|
+
rspec-terraform (0.1.0.pre.16)
|
5
5
|
rspec (>= 3.0)
|
6
|
-
ruby-terraform (= 1.7.0.pre.
|
6
|
+
ruby-terraform (= 1.7.0.pre.13)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -43,7 +43,7 @@ GEM
|
|
43
43
|
sawyer (~> 0.9)
|
44
44
|
open4 (1.3.4)
|
45
45
|
parallel (1.22.1)
|
46
|
-
parser (3.1.2.
|
46
|
+
parser (3.1.2.1)
|
47
47
|
ast (~> 2.4.1)
|
48
48
|
public_suffix (4.0.7)
|
49
49
|
rainbow (3.1.1)
|
@@ -83,24 +83,24 @@ GEM
|
|
83
83
|
diff-lcs (>= 1.2.0, < 2.0)
|
84
84
|
rspec-support (~> 3.11.0)
|
85
85
|
rspec-support (3.11.0)
|
86
|
-
rubocop (1.
|
86
|
+
rubocop (1.35.0)
|
87
87
|
json (~> 2.3)
|
88
88
|
parallel (~> 1.10)
|
89
|
-
parser (>= 3.1.
|
89
|
+
parser (>= 3.1.2.1)
|
90
90
|
rainbow (>= 2.2.2, < 4.0)
|
91
91
|
regexp_parser (>= 1.8, < 3.0)
|
92
92
|
rexml (>= 3.2.5, < 4.0)
|
93
|
-
rubocop-ast (>= 1.
|
93
|
+
rubocop-ast (>= 1.20.1, < 2.0)
|
94
94
|
ruby-progressbar (~> 1.7)
|
95
95
|
unicode-display_width (>= 1.4.0, < 3.0)
|
96
|
-
rubocop-ast (1.
|
96
|
+
rubocop-ast (1.21.0)
|
97
97
|
parser (>= 3.1.1.0)
|
98
98
|
rubocop-rake (0.6.0)
|
99
99
|
rubocop (~> 1.0)
|
100
100
|
rubocop-rspec (2.12.1)
|
101
101
|
rubocop (~> 1.31)
|
102
102
|
ruby-progressbar (1.11.0)
|
103
|
-
ruby-terraform (1.7.0.pre.
|
103
|
+
ruby-terraform (1.7.0.pre.13)
|
104
104
|
immutable-struct (~> 2.4)
|
105
105
|
lino (~> 3.0)
|
106
106
|
ruby2_keywords (0.0.5)
|
@@ -142,4 +142,4 @@ DEPENDENCIES
|
|
142
142
|
simplecov
|
143
143
|
|
144
144
|
BUNDLED WITH
|
145
|
-
2.3.
|
145
|
+
2.3.20
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Terraform
|
5
|
+
module Matchers
|
6
|
+
class IncludeOutputChange
|
7
|
+
attr_reader :definition
|
8
|
+
|
9
|
+
def initialize(definition)
|
10
|
+
@definition = definition
|
11
|
+
end
|
12
|
+
|
13
|
+
def matches?(plan)
|
14
|
+
!definition_matches(plan).empty?
|
15
|
+
end
|
16
|
+
|
17
|
+
def with_value(_)
|
18
|
+
self
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def definition_matches(plan)
|
24
|
+
plan.output_changes_matching(definition)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative './matchers/include_resource_change'
|
4
|
+
require_relative './matchers/include_output_change'
|
4
5
|
|
5
6
|
module RSpec
|
6
7
|
module Terraform
|
@@ -28,6 +29,30 @@ module RSpec
|
|
28
29
|
def include_resource_deletion(definition = {})
|
29
30
|
include_resource_change(definition.merge(delete?: true))
|
30
31
|
end
|
32
|
+
|
33
|
+
def include_resource(definition = {})
|
34
|
+
include_resource_change(definition.merge(present_after?: true))
|
35
|
+
end
|
36
|
+
|
37
|
+
def include_output_change(definition = {})
|
38
|
+
IncludeOutputChange.new(definition)
|
39
|
+
end
|
40
|
+
|
41
|
+
def include_output_creation(definition = {})
|
42
|
+
include_output_change(definition.merge(create?: true))
|
43
|
+
end
|
44
|
+
|
45
|
+
def include_output_update(definition = {})
|
46
|
+
include_output_change(definition.merge(update?: true))
|
47
|
+
end
|
48
|
+
|
49
|
+
def include_output_deletion(definition = {})
|
50
|
+
include_output_change(definition.merge(delete?: true))
|
51
|
+
end
|
52
|
+
|
53
|
+
def include_output(definition = {})
|
54
|
+
include_output_change(definition.merge(present_after?: true))
|
55
|
+
end
|
31
56
|
end
|
32
57
|
end
|
33
58
|
end
|
data/rspec-terraform.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.required_ruby_version = '>= 2.7'
|
39
39
|
|
40
40
|
spec.add_dependency 'rspec', '>= 3.0'
|
41
|
-
spec.add_dependency 'ruby-terraform', '1.7.0.pre.
|
41
|
+
spec.add_dependency 'ruby-terraform', '1.7.0.pre.13'
|
42
42
|
|
43
43
|
spec.add_development_dependency 'bundler'
|
44
44
|
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.
|
4
|
+
version: 0.1.0.pre.16
|
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-
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.7.0.pre.
|
33
|
+
version: 1.7.0.pre.13
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.7.0.pre.
|
40
|
+
version: 1.7.0.pre.13
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- bin/setup
|
225
225
|
- lib/rspec/terraform.rb
|
226
226
|
- lib/rspec/terraform/matchers.rb
|
227
|
+
- lib/rspec/terraform/matchers/include_output_change.rb
|
227
228
|
- lib/rspec/terraform/matchers/include_resource_change.rb
|
228
229
|
- lib/rspec/terraform/version.rb
|
229
230
|
- rspec-terraform.gemspec
|