Blog

MockBox 1.3 Released

Luis Majano December 12, 2010

Spread the word

Luis Majano

December 12, 2010

Spread the word


Share your thoughts

After much inspiration during long baby duty nights, we bring you today MockBox version 1.3.  This release sports a revamp of the entire documentation structure both on the wiki and internally in the API.  This was a huge ticket for me, as I wanted to make the introduction into mocking and unit testing a little bit easier.  So hopefully, this will help out all you curious folks who want to venture down into MockLand!  So let's review it:

So we already said the documentation and API docs are brand new, great! So what else:
  • coldbox-1057 mocking argument normalization, diff expectations when name-value or positional argument calling.  This means that you can test with ordered or name-value pairs or even argument collections and MockBox will determine the right matching values for you.  If you are new to MockBox, don't worry, this was a cool fix to how MockBox matches arguments to results.
  • coldbox-1144 change all mock methods to their $ name equivalents on the MockBox CFC so they are documented like so.  This was not the case on version 1.2 where we created method aliases, this just added overhead and not a very clear mocking API.  So this was revamped and I documented the functions out of it.

New Verification Methods


Unit testing and mocking cannot be possible without behavior verification, so we expanded our mocking language to include several new methods to help you verify when these mocked methods are called.  Also remember that MockBox has call logging integrated so it can keep track of method calls and their real arguments, so you can assert them later via the $callLog() method.


$verifyCallCount becomes $times()


This is just an alias, but it is way shorter and more meaningful, which basically let's you find out how many times ALL mocked methods have been called on a target, or if you pass in the method name as an argument, then only the times that specific method was called.


$atMost() and $atLeast()



These verification methods allow you to track the minimum and maximum times ALL mocked methods have been called or if you pass in the method name, the specific method.  This is great to achieve minimum number or maximum number of calls to a specific method have to be made and then asserted.


$never() and $once()


These are great shortcuts to find out if a mocked method or ALL mocked methods have NEVER been called or they have been called exactly one time.


$reset()


This little gem provides you with a way to reset all method call counter and call loggers so you can start fresh and mock again!


This concludes our 1.3 release. We have lots of great ideas for our next version MockBox 2.0 which will includes some awesomeness when it comes down to expectations, verifications and behavior. We are already planning several features that will allow you to verify when methods with specific arguments have been called, create literal arguments instead of data, mock network failures and much more. So get ready to start working in MockLand, it truly is great to Mock!

Add Your Comment

Recent Entries

Ortus June 2024 Newsletter!

Ortus June 2024 Newsletter!

Welcome to the latest edition of the Ortus Newsletter! This month, we're excited to bring you highlights from our sessions at CFCamp and Open South Code, as well as a sneak peek into our upcoming events. Discover the latest developments in BoxLang, our dynamic new JVM language, and catch up on all the insightful presentations by our expert team. Let's dive in!

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang June 2024 Newsletter!

BoxLang June 2024 Newsletter!

We're thrilled to bring you the latest updates and exciting developments from the world of BoxLang. This month, we're diving into the newest beta release, introducing a new podcast series, showcasing innovative integrations, and sharing insights from recent events. Whether you're a seasoned developer or just getting started, there's something here for everyone to explore and enjoy.

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang 1.0.0 Beta 3 Launched

BoxLang 1.0.0 Beta 3 Launched

We are thrilled to announce the release of BoxLang 1.0.0-Beta 3! This latest beta version is packed with exciting new features and essential bug fixes, including robust encryption functionality, enhanced Java interoperability, and more efficient event handling. Key highlights include the introduction of query caching capabilities, seamless coercion of Java Single Abstract Method (SAM) interfaces from BoxLang functions, and support for virtual thread executors. So, let’s dive into the details of what’s new in BoxLang 1.0.0-Beta 3 and how you can start leveraging these updates today!

Luis Majano
Luis Majano
June 28, 2024