kitchen-inspec 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b30d9e5c6b9fd88003e8b4c3e63243f612f15c2f444ff093f78816fd6703e95
4
- data.tar.gz: a7742bc13d653d3fc15c471a735c20156677984921a04b63b1548f49ac0e247f
3
+ metadata.gz: fd8f48692455036fcb4a096239db49ea77cc35a40dde906080951d4df283775d
4
+ data.tar.gz: 3876f0417b27d9c7a34e44a9127937b404af9249b25b530d0ff94a0abf85ee4e
5
5
  SHA512:
6
- metadata.gz: a71750f6211666c89734f3068299418a675b37ea16e842b0159ccb61f13a245e5965c32ffda33b86ad7620a4597c400705a19e4c1628774b26bd81fb75db81f0
7
- data.tar.gz: 95b8cad3c60739fbe3a8316f1a1cc2979b6be69bc7115d4b8d1ad8d8f9f7313cb1dd2108c3b30e8e7013d619f4a1ae64567466b3dfbdba34d7f792b75b19c7c6
6
+ metadata.gz: a8d485c2c565ad7c5867e11f8b749cc924d2319d0e9f44e767d8a230805c1b9064fa6ac3a9c245218927f03f5115a361c0bfa70649725374056be33f558befa2
7
+ data.tar.gz: 1b3c751144281043f25495e2c38d43a31d189eafecfb84a6b0ea1f7ffc9abc3b70c54ca9d90af6cb5d900157daa25ee4e62057340d7960ae21b82f978a921e57
@@ -69,9 +69,8 @@ module Kitchen
69
69
  opts = runner_options(instance.transport, state, instance.platform.name, instance.suite.name)
70
70
  logger.debug "Options #{opts.inspect}"
71
71
 
72
- # add attributes
73
- opts[:attrs] = config[:attrs]
74
- opts[:attributes] = Hashie.stringify_keys config[:attributes] unless config[:attributes].nil?
72
+ # add inputs
73
+ setup_inputs(opts, config)
75
74
 
76
75
  # setup logger
77
76
  ::Inspec::Log.init(STDERR)
@@ -100,6 +99,32 @@ module Kitchen
100
99
 
101
100
  private
102
101
 
102
+ def setup_inputs(opts, config)
103
+ inspec_version = Gem::Version.new(::Inspec::VERSION)
104
+
105
+ # Handle input files
106
+ if config[:attrs]
107
+ logger.warn("kitchen-inspec: please use 'input-files' instead of 'attrs'")
108
+ config[:input_files] = config[:attrs]
109
+ end
110
+ if config[:input_files]
111
+ # Note that inspec expects the singular inflection, input_file
112
+ files_key = inspec_version >= Gem::Version.new("3.10") ? :input_file : :attrs
113
+ opts[files_key] = config[:input_files]
114
+ end
115
+
116
+ # Handle YAML => Hash inputs
117
+ if config[:attributes]
118
+ logger.warn("kitchen-inspec: please use 'inputs' instead of 'attributes'")
119
+ config[:inputs] = config[:attributes]
120
+ end
121
+ if config[:inputs]
122
+ # Version here is dependent on https://github.com/inspec/inspec/issues/3856
123
+ inputs_key = inspec_version >= Gem::Version.new("4.10") ? :inputs : :attributes
124
+ opts[inputs_key] = Hashie.stringify_keys config[:inputs]
125
+ end
126
+ end
127
+
103
128
  # (see Base#load_needed_dependencies!)
104
129
  def load_needed_dependencies!
105
130
  require "inspec"
@@ -20,6 +20,6 @@
20
20
  module Kitchen
21
21
  module Verifier
22
22
  # Version string for InSpec Kitchen verifier
23
- INSPEC_VERSION = "1.1.0".freeze
23
+ INSPEC_VERSION = "1.2.0".freeze
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-inspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-18 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inspec
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.0.1
96
+ rubygems_version: 3.0.3
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: A Test Kitchen Verifier for InSpec