Skip to content

Commit

Permalink
Swap double quotes for single to satisfy the linter
Browse files Browse the repository at this point in the history
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
  • Loading branch information
clintoncwolfe committed Jun 5, 2019
1 parent 600e0e8 commit cbba5a0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions lib/kitchen/verifier/inspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def setup_inputs(opts, config)
end
if config[:input_files]
# Note that inspec expects the singular inflection, input_file
files_key = inspec_version >= Gem::Version.new('3.10') ? :input_file : :attrs
files_key = inspec_version >= Gem::Version.new("3.10") ? :input_file : :attrs
opts[files_key] = config[:input_files]
end

Expand All @@ -119,7 +119,7 @@ def setup_inputs(opts, config)
config[:inputs] = config[:attributes]
end
if config[:inputs]
inputs_key = inspec_version >= Gem::Version.new('3.11') ? :inputs : :attributes
inputs_key = inspec_version >= Gem::Version.new("3.11") ? :inputs : :attributes
opts[inputs_key] = Hashie.stringify_keys config[:inputs]
end
end
Expand Down
50 changes: 25 additions & 25 deletions spec/kitchen/verifier/inspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,24 @@
end
end

describe '#setup_inputs' do
describe "#setup_inputs" do
let(:input_opts) { {} }
let(:input_cfg) { {} }
context "when InSpec is recent" do
context "when file inputs are provided" do
context "using modern syntax" do
it 'should place them in input_file' do
stub_const('Inspec::VERSION', '3.99.0')
input_cfg[:input_files] = ['a.yaml', 'b.yaml']
it "should place them in input_file" do
stub_const("Inspec::VERSION", "3.99.0")
input_cfg[:input_files] = ["a.yaml", "b.yaml"]
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :input_file
expect(input_opts[:input_file]).to eq(input_cfg[:input_files])
end
end
context "using legacy syntax" do
it 'should place them in input_file' do
stub_const('Inspec::VERSION', '3.99.0')
input_cfg[:attrs] = ['a.yaml', 'b.yaml']
it "should place them in input_file" do
stub_const("Inspec::VERSION", "3.99.0")
input_cfg[:attrs] = ["a.yaml", "b.yaml"]
# TODO: this should emit a warning
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :input_file
Expand All @@ -166,21 +166,21 @@
end
context "when hash inputs are provided" do
context "using modern syntax" do
it 'should place them in inputs' do
stub_const('Inspec::VERSION', '3.99.0')
it "should place them in inputs" do
stub_const("Inspec::VERSION", "3.99.0")
input_cfg[:inputs] = { a: 1, b: 2 }
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :inputs
expect(input_opts[:inputs]).to eq({ 'a' => 1, 'b' => 2 })
expect(input_opts[:inputs]).to eq({ "a" => 1, "b" => 2 })
end
end
context "using legacy syntax" do
it 'should place them in inputs' do
stub_const('Inspec::VERSION', '3.99.0')
it "should place them in inputs" do
stub_const("Inspec::VERSION", "3.99.0")
input_cfg[:attributes] = { a: 1, b: 2 }
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :inputs
expect(input_opts[:inputs]).to eq({ 'a' => 1, 'b' => 2 })
expect(input_opts[:inputs]).to eq({ "a" => 1, "b" => 2 })
end
end
end
Expand All @@ -189,18 +189,18 @@
context "when InSpec is old" do
context "when file inputs are provided" do
context "using modern syntax" do
it 'should place them in attrs' do
stub_const('Inspec::VERSION', '3.0.0')
input_cfg[:input_files] = ['a.yaml', 'b.yaml']
it "should place them in attrs" do
stub_const("Inspec::VERSION", "3.0.0")
input_cfg[:input_files] = ["a.yaml", "b.yaml"]
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :attrs
expect(input_opts[:attrs]).to eq(input_cfg[:input_files])
end
end
context "using legacy syntax" do
it 'should place them in input_file' do
stub_const('Inspec::VERSION', '3.0.0')
input_cfg[:attrs] = ['a.yaml', 'b.yaml']
it "should place them in input_file" do
stub_const("Inspec::VERSION", "3.0.0")
input_cfg[:attrs] = ["a.yaml", "b.yaml"]
# TODO: this should emit a warning
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :attrs
Expand All @@ -210,21 +210,21 @@
end
context "when hash inputs are provided" do
context "using modern syntax" do
it 'should place them in attributes' do
stub_const('Inspec::VERSION', '3.0.0')
it "should place them in attributes" do
stub_const("Inspec::VERSION", "3.0.0")
input_cfg[:inputs] = { a: 1, b: 2 }
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :attributes
expect(input_opts[:attributes]).to eq({ 'a' => 1, 'b' => 2 })
expect(input_opts[:attributes]).to eq({ "a" => 1, "b" => 2 })
end
end
context "using legacy syntax" do
it 'should place them in attributes' do
stub_const('Inspec::VERSION', '3.0.0')
it "should place them in attributes" do
stub_const("Inspec::VERSION", "3.0.0")
input_cfg[:attributes] = { a: 1, b: 2 }
verifier.send(:setup_inputs, input_opts, input_cfg)
expect(input_opts.keys).to include :attributes
expect(input_opts[:attributes]).to eq({ 'a' => 1, 'b' => 2 })
expect(input_opts[:attributes]).to eq({ "a" => 1, "b" => 2 })
end
end
end
Expand Down

0 comments on commit cbba5a0

Please sign in to comment.