Skip to content

Commit

Permalink
update require_gems test
Browse files Browse the repository at this point in the history
  • Loading branch information
Crunch09 committed Aug 7, 2016
1 parent 539154a commit 70ba8c5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/test_plugin_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70ba8c5

Please sign in to comment.