Extension:Expect/de

Category:GPL licensed extensions/de
MediaWiki-Erweiterungen
Expect
Freigabestatus: BetaCategory:Beta status extensions/de
Einbindung API Category:API extensions/de
Beschreibung Provides extended assertions for Scribunto.
Autor(en)
Letzte Version 0.1.0
Kompatibilitätspolitik Der Master behält die Abwärtskompatibilität bei.
MediaWiki >= 1.33
Datenbankänderungen Nein
Lizenz GNU General Public License 2.0 oder später
Herunterladen Category:Extensions in GitHub version control/de
README, LDoc
Übersetze die Expect-Erweiterung
Category:All extensions/de

Expect provides an extended framework for assertions.

It is based upon compute graphs that are predefined before being used for extensive checks.

Installation

Expect depends on modules from the Scribunto extension.

  • Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens Expect im Ordner extensions/ ablegen.
  • Folgenden Code am Ende deiner LocalSettings.php -Datei einfügen:
    wfLoadExtension( 'Expect' );
    
  • Yes Erledigt – Navigiere zu Special:Version in deinem Wiki, um zu überprüfen, ob die Erweiterung erfolgreich installiert wurde.

Verwendung

The workflow is to define a graph, and then provide arguments to that graph. The definition is done once, but the graph can be reused several times.

-- Load the lib
local expect = require 'expect'

-- Create a few compute graphs
local expectString = expect:create():asType():toBeEqual( 'string' )
local expectNoColon = expect:create():toBeUMatch( '^[^:]*$' )

-- Create an exported hash
local p = {}

-- Add a function
function p.helloWorld( name )
	-- Call the compute graphs
	expectString( name )
	expectNoColon( name )

	-- Should be safe to do whatever now
	return mw.ustring.format( 'Hi there %s!', name )
end

-- Return the exported hash
return p

For further help, see the generated LDoc documentation.

Entwicklung

For recreating the Vagrant-based development environment, see Expect: Topics/Vagrant.

Siehe auch

Category:API extensions/de Category:All extensions/de Category:Beta status extensions/de Category:Extensions in GitHub version control/de Category:GPL licensed extensions/de Category:ScribuntoExternalLibraryPaths extensions/de