Extension:Pickle/nn

Spec-utvidinga (eller Framferdsdreven utvikling, BDD) er ei utviding for Rspec/Busted-typetesting 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 eit veldig tynt integrasjonslag mot PHP og nokre få Lua-modular og tilhøyrande lokaliseringar. The actual code is still valid Lua, and all editing tools will work, except for missing definitions for intellisense in the various editors.

The extension is called Pickle because you pick on your code. It is also a play with words; gherkins are used for pickles. Gherkin 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.

Eit oversyn over pickle-utvidinga frå eit brukarperspektiv finst på.

Installering
Koden er berre tilgjengeleg frå GitHub: jeblad/Pickle medan den vert utvikla. Spec avheng av -utvidinga. For å attskape det Vagrant-baserte utviklingsmiljøet, sjå Pickle: Topics/Vagrant.

Bruk
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   function is called, and thus the calling run-time environment are bound without the global functions. To insert the global functions in the correct run-time environment the  call use. Without the  call the correct run-time environment must be present while creating the functions. Thus a call  must install the global functions.

Switching between the styles are done by the config  or.

Viss du har ein modul som «Module:HelloWorld», det allestadsnærverande og ganske irriterande dømet, så vil det kodast som noko à la

Deretter, på ei testside ville du teste det på denne måten


 * Implicit form


 * Explicit form

I den endelege versjonen kan nokre liner i byrjinga og slutten verte fjerna.

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