# encoding: utf-8 require 'spec_helper' require 'fedux_org_stdlib/gem_plugins/plugin_manager' RSpec.describe GemPlugins::PluginManager do context '#load_plugins' do it 'loads available plugins' do manager = GemPlugins::PluginManager.new prefix: 'fedux_org_stdlib-fixtures-plugin_manager-' manager.disable_plugin 'plugin-no_load' manager.load_plugins expect('FeduxOrgStdlib::Fixtures::PluginManager::Plugin::Load').to be_defined end end context '#disable' do it 'disable plugin' do manager = GemPlugins::PluginManager.new prefix: 'fedux_org_stdlib-fixtures-plugin_manager-' manager.disable_plugin 'plugin-no_load' manager.load_plugins expect('FeduxOrgStdlib::Fixtures::PluginManager::Plugin::NoLoad').not_to be_defined end it 'outputs warning if plugin cannout be found' do manager = GemPlugins::PluginManager.new prefix: 'fedux_org_stdlib-fixtures-plugin_manager-' result = capture :stderr do manager.disable_plugin 'plugin-blub' end expect(result).to include 'plugin-blub' end end end