Fixed two test order dependency bugs.

+ Do extra cleanup of loaded_specs for the dependencies.
+ Ensure rake is actually activated.

Fixes #4030.
Fixes #4026.

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-05-06 14:15:52 -07:00
parent 4d4e8e1feb
commit 92d8cd4df9

View file

@ -55,6 +55,7 @@ module InstallerTestHelpers
# Clean up any activated gems
Gem.loaded_specs.delete('inspec-test-fixture')
Gem.loaded_specs.delete('ordinal_array')
end
end
@ -194,6 +195,9 @@ class PluginInstallerInstallationTests < Minitest::Test
def test_install_a_gem_with_conflicting_depends_from_rubygems_org
ENV['INSPEC_CONFIG_DIR'] = File.join(@config_dir_path, 'empty')
spec = Gem::Specification._all.find { |s| s.name == "rake" }
spec.activate
ex = assert_raises(Inspec::Plugin::V2::InstallError) do
@installer.install('inspec-test-fixture', version: '= 0.1.1')
end