mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Merge pull request #3658 from jekyll/fix-jekyll-minitest-rspec-mocks
Create #mock_expects that goes directly to RSpec Mocks.
This commit is contained in:
@@ -32,6 +32,11 @@ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => tru
|
||||
class JekyllUnitTest < Minitest::Test
|
||||
include ::RSpec::Mocks::ExampleMethods
|
||||
|
||||
def mocks_expect(*args)
|
||||
RSpec::Mocks::ExampleMethods::ExpectHost.instance_method(:expect).\
|
||||
bind(self).call(*args)
|
||||
end
|
||||
|
||||
def before_setup
|
||||
::RSpec::Mocks.setup
|
||||
super
|
||||
|
||||
@@ -4,10 +4,11 @@ class TestCommand < JekyllUnitTest
|
||||
context "when calling .add_build_options" do
|
||||
should "add common options" do
|
||||
cmd = Object.new
|
||||
expect(cmd).to receive(:option).at_least(:once)
|
||||
mocks_expect(cmd).to receive(:option).at_least(:once)
|
||||
Command.add_build_options(cmd)
|
||||
end
|
||||
end
|
||||
|
||||
context "when calling .process_site" do
|
||||
context "when fatal error occurs" do
|
||||
should "exit with non-zero error code" do
|
||||
|
||||
Reference in New Issue
Block a user