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

Fix inspec appveyor test with the new local train transport #2376

Merged
merged 2 commits into from Dec 6, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion inspec.gemspec
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.3'

spec.add_dependency 'train', '~> 0.30'
spec.add_dependency 'train', '~> 0.31', '>= 0.31.1'
spec.add_dependency 'thor', '~> 0.19'
spec.add_dependency 'json', '>= 1.8', '< 3.0'
spec.add_dependency 'rainbow', '~> 2'
Expand Down
4 changes: 2 additions & 2 deletions test/helper.rb
Expand Up @@ -35,7 +35,7 @@
require_relative '../lib/bundles/inspec-habitat'

require 'train'
CMD = Train.create('local').connection
CMD = Train.create('local', command_runner: :generic).connection
TMP_CACHE = {}

Inspec::Log.logger = Logger.new(nil)
Expand Down Expand Up @@ -85,7 +85,7 @@ def backend
mock = @backend.backend

# create all mock files
local = Train.create('local').connection
local = Train.create('local', command_runner: :generic).connection

# set os emulation
mock.mock_os(@platform)
Expand Down
6 changes: 3 additions & 3 deletions test/unit/runner_test.rb
Expand Up @@ -5,15 +5,15 @@

describe Inspec::Runner do
describe '#load_attributes' do
let(:runner) { Inspec::Runner.new }
let(:runner) { Inspec::Runner.new({ command_runner: :generic }) }

before do
Inspec::Runner.any_instance.stubs(:validate_attributes_file_readability!)
end

describe 'when backend caching is enabled' do
it 'returns a backend with caching' do
opts = { backend_cache: true }
opts = { command_runner: :generic, backend_cache: true }
runner = Inspec::Runner.new(opts)
backend = runner.instance_variable_get(:@backend)
backend.backend.cache_enabled?(:command).must_equal true
Expand All @@ -22,7 +22,7 @@

describe 'when backend caching is disabled' do
it 'returns a backend without caching' do
opts = { backend_cache: false }
opts = { command_runner: :generic, backend_cache: false }
runner = Inspec::Runner.new(opts)
backend = runner.instance_variable_get(:@backend)
backend.backend.cache_enabled?(:command).must_equal false
Expand Down