Extension:Pickle/nb

Spec (eller Oppførselsdrevet utvikling, BDD) utvidelsen er en utviding for Rspec/Busted type testing i. Spec type testing is the same type of unit testing that is done in Rspec, Busted and other similar testing frameworks. Den vil tilby et veldig tynt integrasjonslag mot PHP og noen få Lua-moduler og tilhørende lokaliseringer.

The actual code is still valid Lua, and all editing tools will work, except for missing definitions for intellisense in the various editors. En oversikt over pickle-utvidelsen fra et brukerperspektiv finnes på.

The extension is called Pickle because you pick on your code.

Still note that gherkins are used for pickles, and that is also a language for "step" style testing, a kind of acceptance testing, so you might say these kinds of code snippets are pickles.

At some time in the future the extension might be extended with step style testing, and then the name would fit even better.

Installering
Koden er kun tilgjengelig fra GitHub: jeblad/Pickle mens den utvikles. Spec avhenger av -utvidelsen. For å gjenskape det Vagrant-baserte utviklingsmiljøet, se.

Usage
The extension can be configured for implicit style or explicit style of tests. The implicit style piggybacks the installation on the  call, but this depends on a functional   call. The Scribunto extension limits the  call, and according to Extension:Scribunto/Lua reference manual it is not quite predictable, thus only the explicit style will work.

The reason for the dependency on  is that the functions are constructed before the describe is called, and thus the calling environment are bound without the global functions. To insert the globals in the correct environment the  call use. Without this call the environment must be created before the function, thus an explicit call for installing the globals must be available.

Switching between the styles are done by the config  or.

Hvis du har en modul slik som «Module:HelloWorld», det allestedsnærværende og ganske irriterende eksemplet, så vil det være kodet som noe ala

Deretter, på en testside, vil du teste dette som det etterfølgende


 * Implicit form


 * Explicit form

På den endelige utgaven kan noen av linjene i starten og på slutten bli fjernet.

There might be additional changes, like where the  call is available, and how many   calls that can be made.