2017 © Pedro Peláez
 

library mockolate

image

jeroendelau/mockolate

  • Monday, June 6, 2016
  • by jeroendelau
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • ActionScript
  • 0 Dependents
  • 0 Suggesters
  • 27 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Mockolate.

fake chocolate, mock objects and test spies.

mockolate.org Documentation, examples, elaboration. Drew Bourne Contact., (*1)

This tagline is probably a hint that Mockolate is most useful when testing software. Whether you are doing test-driven-development, post-crunch-time fill-in-the-gaps, or exploratory-I-have-no-idea-what-is-going-on testing Mockolate can help., (*2)

Mock Objects

A mock object can be used to simulate the behaviour of complex, real (non-mock) objects when using the real object would be impractical or impossible. Situations where a mock object would be useful:, (*3)

  • When an object is slow (like a database or webservice),
  • is non-deterministic (like the current time),
  • has states that are difficult to reproduce (like network connections)

The above is mostly appropriated from Mock Objects at Wikipedia. I could keep rewriting it here, but it's really quite a good read., (*4)

Test Spies

In espionage, spies infiltrate a system, recording and relaying information to their handlers. The handlers may use that information to check facts, inform others, or take action., (*5)

In testing, a Test Spy records which methods are called, which getters are got, which setters are set. The handler (typically a testcase) can then check the facts against what should or should not have happened and take action (typically an assertion)., (*6)

Mockolate?

  • clean consistent syntax
  • expectation-based or record-replay
  • dynamically generates proxy Classes
  • supports handcoded proxy Classes
  • provides a FlexUnit 4 Rule and Runner
  • uses proven libraries, FlexUnit 4, FLoxy and Hamcrest-as3

Next

Head over to http://mockolate.org/ for documentation and examples:, (*7)

Thanks

Richard Szalay with FLoxy, and Maxim Porges with Loom for their work on Class proxy generation., (*8)

Brian LeGros for hassling me about -mock-as3- enough that I added class proxy generation to it. Except you can ignore that project in favour of Mockolate., (*9)

The Versions

06/06 2016

dev-master

9999999-dev

  Sources   Download