diff --git a/test/test_plugin_manager.rb b/test/test_plugin_manager.rb index c43c127261b..c625c3a84a2 100644 --- a/test/test_plugin_manager.rb +++ b/test/test_plugin_manager.rb @@ -41,13 +41,18 @@ def with_no_gemfile end context "require gems" do - should "check if configured gems are allowed" do - allow(Jekyll::External).to receive(:require_with_graceful_fail).and_return(nil) - site = double(:gems => %w(jemoji foobar)) + should "invoke `require_with_graceful_fail`" do + gems = %w(jemojii foobar) + + expect(Jekyll::External).to( + receive(:require_with_graceful_fail).with(gems).and_return(nil) + ) + site = double(:gems => gems) plugin_manager = PluginManager.new(site) - expect(plugin_manager).to receive(:plugin_allowed?).with("jemoji") - expect(plugin_manager).to receive(:plugin_allowed?).with("foobar") + allow(plugin_manager).to receive(:plugin_allowed?).with("foobar").and_return(true) + allow(plugin_manager).to receive(:plugin_allowed?).with("jemojii").and_return(true) + plugin_manager.require_gems end end