Make writing PhpSpec examples and matchers in your Specs a little easier in Sublime Text 2 & 3.
This plugin is available as a sublime package search for "PhpSpec Snippets".
Alternatively clone this repository into your Packages/ folder.
Currently this plugin provides a command to help writing examples with PhpSpec and severals snippets to use.
I hate typing underscores, and I wrote this command to ease that pain. It can be accessed in two ways:
- Open the command panel and type "PhpSpec: complete example"
- Right click and select "PhpSpec: complete example"
The plugin will take the text from the current line and transform it into a PhpSpec example. You can also create examples over multiple lines.
The snippet generator doesn't care if you include or leave out the
function declaration and/or it_/its_, the generated example
will prepend those automatically.
bct BeConstructedThrough.
beConstructedThrough('',array());bcw BeConstructedWith.
beConstructedWith();let Setup method for phpspec.
function let()
{
}letgo Teardown method for phpspec.
function letgo()
{
}sb shouldBe.
shouldBe();snb shouldNotBe.
shouldNotBe();sbi shouldBeAnInstanceOf.
shouldBeAnInstanceOf();snbi shouldNotBeAnInstanceOf.
shouldNotBeAnInstanceOf();sbl shouldBeLike.
shouldBeLike();snbl shouldNotBeLike.
shouldNotBeLike();se shouldEqual.
shouldBeEqual();sne shouldNotEqual.
shouldNotEqual();sht shouldHaveType.
shouldHaveType();snht shouldNotHaveType.
shouldNotHaveType();si shouldImplement.
shouldImplement();sni shouldNotImplement.
shouldNotImplement();sr shouldReturn.
shouldReturn();snr shouldNotReturn.
shouldNotReturn();st shouldThrow.
shouldThrow('')->during();wr willReturn.
willReturn();wt willThrow.
willThrow();sbc shouldBeCalled.
shouldBeCalled();bnbc shouldNotBeCalled.
shouldNotBeCalled();bhbc shouldHaveBeenCalled.
shouldHaveBeenCalled();snhbc shouldNotHaveBeenCalled.
shouldNotHaveBeenCalled();- Fix code for positioning cursor (it's a bit tempremental)
