Name |
Ceylon Test Platform Module |
||||||
---|---|---|---|---|---|---|---|
Category |
SDK
The Ceylon SDK |
||||||
Backends | JVM JavaScript | ||||||
Maven coordinates | |||||||
Compatible Ceylon release |
JVM: 1.2.x, 1.3.x (latest) JavaScript: 1.2.1, 1.2.2, 1.3.x (latest) |
||||||
Published | Feb 11, 2016 | ||||||
Stats |
Downloads (JVM): 555 Downloads (JS): 188 Source downloads: 555 |
||||||
Authors |
Tomáš Hradec Tom Bentley |
||||||
License | Apache Software License | ||||||
Description |
The Tests execute the code of the module under test and can make assertions about what it does. For example,
GETTING STARTEDTests can be written as top level functions … test void shouldAlwaysSucceed() {} … or organized inside classes. class YodaTest() { test void shouldBeJedi() { assert(yoda is Jedi); } test void shouldHavePower() { assert(yoda.midichloriansCount > 1k); } (notice the ASSERTIONSAssertions can be evaluated by using the language's assert(is Hobbit frodo); assert(exists ring); assertNotEquals(frodo, sauron); assertThatException(() => gandalf.castLightnings()).hasType(`NotEnoughMagicPowerException`); A test function which completes without propagating an exception is
classified as a success. A test function which propagates
an HOOKSCommon initialization logic can be placed into separate functions, which run before or after each test. class StarshipTest() { beforeTest void init() => starship.chargePhasers(); afterTest void dispose() => starship.shutdownSystems(); Other options how to hook into tests execution, is to implement DISABLING TESTSSometimes you want to temporarily disable a test or a group of tests,
this can be done via the test ignore("still not implemented") void shouldBeFasterThanLight() { Sometimes the conditions, if the test can be reliable executed,
are know only in runtime, in that case one of the RUNNINGThe most convenient way how to run tests is to use IDE integration
or via command line tools $ceylon test com.acme.mymodule Tests can be also run programmatically, via interface |
||||||
Dependencies |
|
||||||
Usage |
import ceylon.test "1.2.1"; |
||||||
Module links |
Members Imported By Home Code repository Issue tracker Browse Download .car Download .js Download source archive Download module documentation View API documentation |