I’ve grown fond of PHPSpec and the way it “forces” me to write almost logic-less constructors.
I wanted something like testify to make writing specs as easy as possible and came up with Specify.
Usage
The plugin allows writing specs using natural language like
given ClassOne $classOne
given ClassTwo $classtwo
it should do something
it should not do something
it should do something with a really long explanation
to have an output like
function it_should_do_something(ClassOne $classOne, ClassTwo $classtwo)
{
}
function it_should_not_do_something(ClassOne $classOne, ClassTwo $classtwo)
{
}
function it_should_do_something_with_a_really_long_explanation(ClassOne $classOne, ClassTwo $classtwo)
{
}
The “given” lines are optional and are there to specify dependencies for the __construct
method.
To activate the plugin select the natural language lines, bring up the Command Palette and run
Specify - create PHPSpec specs methods from selection
The plugin is way less “intelligent” than testify
is and will do just that. Right now the plugin is available on GitHub and will be available via Package Control soon.