Extension:Pickle/ja

The Pickle (or Behavior-driven development, BDD, previously Spec) extension is an extension for "spec" style testing for. Spec type testing is the same type of unit testing that is done in Rspec, Busted and other similar testing frameworks. PHPといくつかのLuaモジュールとそのローカライゼーションに非常に薄い統合を提供することになります. 実際のコードは有効なLuaのままであり、各種エディタのインテリセンスの定義が欠落していることを除けば、すべての編集ツールが動作します.

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.

利用者から見たpickle拡張機能の概要は、に記載されています.

インストール
Specはの拡張機能に依存します. Vagrantベースの開発環境の再構築については、Pickle: Topics/Vagrantを参照してください.

使用法
この拡張機能は、暗黙的なスタイルまたは明示的なスタイルのテスト用に設定することができます. 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.

If you have a module like "Module:HelloWorld", the ubiquitous and quite pesky example, it will be coded as something like

Then on a subpage  you would test this like like the following


 * 暗黙の形式


 * 明示的な形式

暗黙の形式では、最初と最後の行が削除され、return文が新しいコードの終わりに移動されます.

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