update require_gems test

This commit is contained in:
Florian Thomas 2016-08-07 20:54:55 +02:00
parent 539154a158
commit 70ba8c578a
No known key found for this signature in database
GPG Key ID: FCEEC9743EC7B893
1 changed files with 10 additions and 5 deletions

View File

@ -41,13 +41,18 @@ class TestPluginManager < JekyllUnitTest
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