Uploaded image for project: 'TestBox'
  1. TESTBOX-156

Allow a 'callback' argument to be passed to $() and a new $callback() method

    Details

    • Type: Improvement
    • Status: Closed (View workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: MockBox, Support
    • Labels:
      None

      Description

      Luis, we discussed this briefly @ SotR.

      Currently one can specify a expression to use for a $results() value, and the value of that expression is then used as the results for the mocked method.

      It would be occasionally handy for some stub code to be run to provide the results when a mocked method is called. This could be effected by being able to pass a callback to $results(), which is then called to provide the results when the mocked method itself is called.

      Ideally a mocked method should always be able to be fairly dumb, but sometimes in an imperfect world where the mocked method has other dependencies which cannot be mocked out, an actual usable result is necessary. We've needed to do this about... hmmm... 0.5% of the times in out unit tests I think, so this is quite edge-case-y.

      Cheers.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                lmajano Luis Majano
                Reporter:
                daccfml Adam Cameron
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: