Skip to content

Commit

Permalink
Fix inspec appveyor test with the new local train transport (#2376)
Browse files Browse the repository at this point in the history
* test appveyor with ruby#File

Signed-off-by: Jared Quick <jquick@chef.io>

* Update inspec train to version 0.31.1

Signed-off-by: Jared Quick <jquick@chef.io>
  • Loading branch information
jquick authored and adamleff committed Dec 6, 2017
1 parent 1d09f57 commit 31578de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit 31578de

Please sign in to comment.