Method: PluginManagerCliInstall#test_fail_install_from_path_when_it_is_not_a_plugin

Defined in:
lib/plugins/inspec-plugin-manager-cli/test/functional/inspec-plugin_test.rb

#test_fail_install_from_path_when_it_is_not_a_pluginObject



351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/plugins/inspec-plugin-manager-cli/test/functional/inspec-plugin_test.rb', line 351

def test_fail_install_from_path_when_it_is_not_a_plugin
  bad_path = File.join(project_fixtures_path, "plugins", "inspec-egg-white-omelette", "lib", "inspec-egg-white-omelette.rb")
  install_result = run_inspec_process_with_this_plugin("plugin install #{bad_path}")

  assert_empty install_result.stderr
  assert_equal 1, install_result.exit_status, "Exit status should be 1"

  error_message = install_result.stdout.split("\n").last
  assert_includes error_message, "Does not appear to be a plugin"
  assert_includes error_message, "inspec-egg-white-omelette"
  assert_includes error_message, "After probe-loading the supposed plugin, it did not register"
  assert_includes error_message, "Ensure something inherits from 'Inspec.plugin(2)'"
  assert_includes error_message, "installation failed"
end