Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support inspec dir in the test suite dir #55

Merged
merged 3 commits into from
Feb 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ suites:
run_list:
- recipe[os_prepare]
attributes:
- name: contains_inspec
run_list:
- recipe[os_prepare]
attributes:
2 changes: 1 addition & 1 deletion kitchen-inspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
spec.add_dependency 'inspec', '~> 0.13'
spec.add_dependency 'inspec', '~> 0.12'
spec.add_development_dependency 'countloc', '~> 0.4'
spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'rake', '~> 10.0'
Expand Down
4 changes: 2 additions & 2 deletions lib/kitchen/verifier/inspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def load_needed_dependencies!
def local_suite_files
base = File.join(config[:test_base_path], config[:suite_name])
legacy_mode = false
# check for other testing frameworks, we may need to add more
%w{serverspec bats pester rspec cucumber minitest bash}.each { |fw|
# check for testing frameworks, we may need to add more
%w{inspec serverspec bats pester rspec cucumber minitest bash}.each { |fw|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple!

if Pathname.new(File.join(base, fw)).exist?
logger.info("Detected alternative framework tests for `#{fw}`")
legacy_mode = true
Expand Down
1 change: 1 addition & 0 deletions test/integration/contains_inspec/inspec/_debug_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p "You are currently running on OS family: #{os[:family] || 'unknown'}, OS release: #{os[:release] || 'unknown'}"
7 changes: 7 additions & 0 deletions test/integration/contains_inspec/inspec/os_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# encoding: utf-8

family = os[:family]

describe os[:family] do
it { should eq family }
end