599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
# File 'lib/plugins/inspec-plugin-manager-cli/test/functional/inspec-plugin_test.rb', line 599
def test_when_a_gem_plugin_can_be_uninstalled
pre_block = Proc.new do |plugin_statefile_data, tmp_dir|
plugin_statefile_data.clear
copy_in_core_config_dir('test-fixture-1-float', tmp_dir)
end
uninstall_result = run_inspec_process_with_this_plugin('plugin uninstall inspec-test-fixture', pre_run: pre_block, post_run: list_after_run)
assert_empty uninstall_result.stderr
assert_equal 0, uninstall_result.exit_status, 'Exit status should be 0'
success_message = uninstall_result.stdout.split("\n").grep(/uninstalled/).last
refute_nil success_message, 'Should find a success message at the end'
assert_includes success_message, 'inspec-test-fixture'
assert_includes success_message, '0.1.0'
assert_includes success_message, 'has been uninstalled'
list_result = uninstall_result.payload.list_result
itf_line = list_result.stdout.split("\n").grep(/inspec-test-fixture/).first
assert_nil itf_line, 'inspec-test-fixture should not appear in the output of inspec list'
end
|