Skip to content

Commit

Permalink
Merge pull request #2 from chef/rename
Browse files Browse the repository at this point in the history
Rename + Update
  • Loading branch information
chris-rock committed Oct 19, 2015
2 parents 44df4a9 + 5e0240a commit 7921f61
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ group :test do
end

gem "vulcano", :git => "git@github.com:chef/vulcanosec.git"
gem 'train', git: 'git@github.com:chef/train.git'
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "kitchen/audit"
require "kitchen/inspec"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions lib/kitchen/verifier/audit.rb → lib/kitchen/verifier/inspec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<fnichol@chef.io>)
# Author:: Christoph Hartmann (<chartmann@chef.io>)
#
# Copyright (C) 2015, Chef Software Inc.
#
Expand All @@ -16,21 +17,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

require "kitchen/verifier/audit_version"
require "kitchen/verifier/inspec_version"
require "kitchen/verifier/base"

module Kitchen

module Verifier

# Audit verifier for Kitchen.
# InSpec verifier for Kitchen.
#
# @author Fletcher Nichol <fnichol@chef.io>
class Audit < Kitchen::Verifier::Base
class InSpec < Kitchen::Verifier::Base

kitchen_verifier_api_version 1

plugin_version Kitchen::Verifier::AUDIT_VERSION
plugin_version Kitchen::Verifier::INSPEC_VERSION

# (see Base#call)
def call(state)
Expand Down Expand Up @@ -88,13 +89,12 @@ def local_suite_files
# @api private
def runner_options_for_ssh(config_data)
opts = instance.transport.send(:connection_options, config_data).dup

{
"backend" => "ssh",
"host" => opts[:hostname],
"port" => opts[:port],
"user" => opts[:username],
"key_file" => opts[:keys]
"key_files" => opts[:keys]
}
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<fnichol@chef.io>)
# Author:: Christoph Hartmann (<chartmann@chef.io>)
#
# Copyright (C) 2015, Chef Software Inc.
#
Expand All @@ -20,7 +21,7 @@ module Kitchen

module Verifier

# Version string for Audit Kitchen verifier
AUDIT_VERSION = "0.1.0"
# Version string for InSpec Kitchen verifier
INSPEC_VERSION = "0.1.0"
end
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<fnichol@chef.io>)
# Author:: Christoph Hartmann (<chartmann@chef.io>)
#
# Copyright (C) 2015, Chef Software Inc.
#
Expand All @@ -20,10 +21,10 @@

require "logger"

require "kitchen/verifier/audit"
require "kitchen/verifier/inspec"
require "kitchen/transport/ssh"

describe Kitchen::Verifier::Audit do
describe Kitchen::Verifier::InSpec do

let(:logged_output) { StringIO.new }
let(:logger) { Logger.new(logged_output) }
Expand Down Expand Up @@ -72,16 +73,16 @@
end

let(:verifier) do
Kitchen::Verifier::Audit.new(config).finalize_config!(instance)
Kitchen::Verifier::InSpec.new(config).finalize_config!(instance)
end

it "verifier api_version is 1" do
expect(verifier.diagnose_plugin[:api_version]).to eq(1)
end

it "plugin_version is set to Kitchen::Verifier::AUDIT_VERSION" do
it "plugin_version is set to Kitchen::Verifier::INSPEC_VERSION" do
expect(verifier.diagnose_plugin[:version]).
to eq(Kitchen::Verifier::AUDIT_VERSION)
to eq(Kitchen::Verifier::INSPEC_VERSION)
end

describe "configuration" do
Expand Down Expand Up @@ -119,7 +120,7 @@
"host" => "boogie",
"port" => 123,
"user" => "dance",
"key_file" => ["/backstage/pass"]
"key_files" => ["/backstage/pass"]
)).
and_return(runner)

Expand Down

0 comments on commit 7921f61

Please sign in to comment.