From 1ed412894280dde475499a52347393e58234094b Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Tue, 30 Apr 2019 15:33:07 -0700 Subject: [PATCH] Functional helper let changes. Moved exec_inspec to inspec_path. Added new exec_inspec that invokes ruby w/ -Ilib (expanded). Decouples from bundler and/or needing inspec-bin to be installed. Signed-off-by: Ryan Davis --- test/functional/helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/functional/helper.rb b/test/functional/helper.rb index c2ef097ec..a0d7869f8 100644 --- a/test/functional/helper.rb +++ b/test/functional/helper.rb @@ -81,7 +81,9 @@ module FunctionalHelper path.gsub!('//vboxsrv', 'C:') if is_windows? path end - let(:exec_inspec) { File.join(repo_path, 'inspec-bin', 'bin', 'inspec') } + let(:inspec_path) { File.join(repo_path, 'inspec-bin', 'bin', 'inspec') } + libdir = File.expand_path "lib" + let(:exec_inspec) { [Gem.ruby, "-I#{libdir}", inspec_path].join " " } let(:mock_path) { File.join(repo_path, 'test', 'unit', 'mock') } let(:profile_path) { File.join(mock_path, 'profiles') } let(:examples_path) { File.join(profile_path, 'old-examples') }