Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 653 Bytes

TODO.rst

File metadata and controls

31 lines (17 loc) · 653 Bytes

TODO

.when.py2.should. and .should.when.py2. .when.py3.should. and .should.when.py3.

Mock and Stubbing support

import sure


def some_helper_function(value):
    if value == 'foo':
        return 'expected'


def main_function_that_depends_on_helper(param1, param2):
    return some_helper_function(param1)


def test_main_function_succeeds_when_helper_returns_expected_result():
    some_helper_function.stub.called_with('foo').returns(['expected'])

    result = main_function_that_depends_on_helper('foo', 'bar')

    result.should.equal('expected')