Just looking at Testbox with a view to moving to BDD. I’ve got the MXUnit adapter inplace so can use assertTrue / assertFalse etc, but reading through the docs and code I can see a makePublic method, but not a injectProperty or injectMethod methods - are these available?
In case it’s useful here’s some small issues / gotchas I’ve found:
Thanks for trying it out. We are still kicking out the kinks for release next week of 1.0
Here are your answers:
injectProperty and injectMethod where actually contributed from us to MXUnit since they came from MockBox. They exist in MockBox however, I guess I will add them to the compat TestCase. If not, we would suggest using MOckBox instead as they basically do what MockBox does.
Yes, the assets run from /testbox mapping, so that must be avaiable. Suggestions?
The run all button must have a bug on it. I will revise it.
On prefix and suffix for “test” it only does prefix, but I will add suffix as well. Granted, this is only for xUnit testing.
Thanks for the additions - just checked it out and working nicely
In terms of the paths to CSS and jQuery files, as the tests are run locally then you could just put the jQuery and CSS inline in the HTML output. It’s not as clean but as bandwidth isn’t an issue it will make it more portable. Alternatively you could use the CDN for jQuery with a fallback to the local version if working offline. Something like:
The CSS would still need to be inline though.
Had a quick look at the BDD stuff and that’s really nice - good work!
MockBox is great - some nice features. TestBox is also really good and nice being able to write tests in a BDD style. The only things I’m missing compared to MXUnit is the transaction decorator and dataproviders but I can replicate these without too much trouble.
Decorators.
We have this in the roadmap but in the near future. Not for our 1.0 release. However. In bdd this becomes easier since you can use closures.
Assert equal.
To tell you the truth I thought it was like that I guess I missed it. It will switch it back around as it should be expected and then actual.
Getting into my stride now with MockBox and TestBox! The prepareMock method is awesome for decorating the CUT
Using BDD is very different to TDD and I’m still not quite confident with how I’m using it but that’s a whole new subject!!
One thing that did trip me up is how to use the $args method to mock behaviour using argument matching as only a simple example with 1 positional argument is shown on the wiki. It might be worth adding named arguments:
Technically, there should not be any difference between them, only if you use preserveArgumentTypes, then you need to do it exactly as it is in code with default arguments as wel.