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:
Jordon Bedwell
2015-04-14 15:15:02 -05:00
3 changed files with 8 additions and 2 deletions

View File

@@ -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

View File

@@ -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