update require_gems test
This commit is contained in:
parent
539154a158
commit
70ba8c578a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue