Skip to content

Commit dd6cdf9

Browse files
committed
testbox additions
1 parent ff91202 commit dd6cdf9

24 files changed

Lines changed: 333 additions & 1 deletion

readme.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A ColdBox Platform Bundle v1.5 for Sublime text 2
1+
# A ColdBox Platform Bundle v1.7 for Sublime text 2
22

33
Get the latest Sublime Text 2 from http://www.sublimetext.com/2.
44

@@ -44,6 +44,32 @@ Code completion for all major ColdBox functions and scopes:
4444
- `cachebox-config ➝` : Creates a new CacheBox.cfc configuration file
4545
- `routes ➝` : Creates a new routing file
4646

47+
### TestBox Snippets
48+
49+
- `bdd ➝` : Creates a new BDD Test Bundle CFC
50+
- `bddi ➝` : Creates a new BDD Test Bundle CFC via Inheritance
51+
- `unit ➝` : Creates a new xUnit Test Bundle CFC
52+
- `uniti ➝` : Creates a new xUnit Test Bundle CFC via Inheritance
53+
- `describe ➝` : A `describe` suite
54+
- `describeFull ➝` : A `describe` suite with all arguments
55+
- `it ➝` : A test spec
56+
- `itFull ➝` : A test spec with all arguments
57+
- `expect ➝` : Starts an expectation DSL with a `toBe()` addition
58+
- `expectFalse ➝` : Does a false expectation expression
59+
- `expectTrue ➝` : Does a true expectation expression
60+
- `expectToThrow ➝` : Starts an expectation that throws an exception
61+
- `afterAll ➝` : An `afterAll()` BDD life-cycle method
62+
- `beforeAll ➝` : An `beforeAll()` BDD life-cycle method
63+
- `aftereach ➝` : An `afterEach()` BDD closure
64+
- `beforeeach ➝` : A `beforeEach()` BDD closure
65+
- `afterTests ➝` : An `afterTests()` xUnit life-cycle method
66+
- `beforeTests ➝` : An `beforeTests()` xUnit life-cycle method
67+
- `teardown ➝` : An `teardown()` xUnit life-cycle method
68+
- `setup ➝` : An `setup()` xUnit life-cycle method
69+
- `debug ➝` : Writes up a non-duplicate `debug()` call
70+
- `debugduplicate ➝` : Writes up a `debug()` call with duplicate
71+
- `console ➝` : TestBox send some output to the console
72+
4773
### Unit-Integration Testing Snippets
4874

4975
- `handlerTest ➝` : Creates a ColdBox Event Handler test case
@@ -96,6 +122,10 @@ If you have the [Package Control](http://wbond.net/sublime_packages/package_cont
96122
- MXUnit Sublime Text bundle - https://github.com/mxunit/sublime-text-2-mxunit
97123

98124
## Changelog
125+
### v1.7
126+
- TestBox additions
127+
- Testing additions
128+
99129
### v1.5
100130
- Handler snippet fixes
101131
- Model skeleton fix

skeletons/test-bdd.sublime-snippet

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<snippet>
2+
<content><![CDATA[
3+
/**
4+
* ${1:My BDD Test}
5+
*/
6+
component{
7+
8+
/*********************************** LIFE CYCLE Methods ***********************************/
9+
10+
// executes before all suites+specs in the run() method
11+
function beforeAll(){
12+
}
13+
14+
// executes after all suites+specs in the run() method
15+
function afterAll(){
16+
}
17+
18+
/*********************************** BDD SUITES ***********************************/
19+
20+
function run(){
21+
// all your suites go here.
22+
}
23+
24+
}
25+
]]></content>
26+
<tabTrigger>bdd</tabTrigger>
27+
<scope>source,text</scope>
28+
<description>TestBox BDD Bundle</description>
29+
</snippet>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<snippet>
2+
<content><![CDATA[
3+
/**
4+
* ${1:My BDD Test}
5+
*/
6+
component extends="testbox.system.testing.BaseSpec"{
7+
8+
/*********************************** LIFE CYCLE Methods ***********************************/
9+
10+
// executes before all suites+specs in the run() method
11+
function beforeAll(){
12+
}
13+
14+
// executes after all suites+specs in the run() method
15+
function afterAll(){
16+
}
17+
18+
/*********************************** BDD SUITES ***********************************/
19+
20+
function run(){
21+
// all your suites go here.
22+
}
23+
24+
}
25+
]]></content>
26+
<tabTrigger>bddi</tabTrigger>
27+
<scope>source,text</scope>
28+
<description>TestBox BDD Bundle With Inheritance</description>
29+
</snippet>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<snippet>
2+
<content><![CDATA[
3+
/**
4+
* ${1:My xUnit Test}
5+
*/
6+
component{
7+
8+
/*********************************** LIFE CYCLE Methods ***********************************/
9+
10+
// executes before all test cases
11+
function beforeTests(){
12+
}
13+
14+
// executes after all test cases
15+
function afterTests(){
16+
}
17+
18+
// executes before every test case
19+
function setup( currentMethod ){
20+
}
21+
22+
// executes after every test case
23+
function teardown( currentMethod ){
24+
}
25+
26+
/*********************************** TEST CASES BELOW ***********************************/
27+
28+
// Remember that test cases MUST have the keyword 'test' in them
29+
function myMethodTest(){
30+
31+
}
32+
33+
}
34+
]]></content>
35+
<tabTrigger>unit</tabTrigger>
36+
<scope>source,text</scope>
37+
<description>TestBox xUnit Bundle</description>
38+
</snippet>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<snippet>
2+
<content><![CDATA[
3+
/**
4+
* ${1:My xUnit Test}
5+
*/
6+
component extends="testbox.system.testing.BaseSpec"{
7+
8+
/*********************************** LIFE CYCLE Methods ***********************************/
9+
10+
// executes before all test cases
11+
function beforeTests(){
12+
}
13+
14+
// executes after all test cases
15+
function afterTests(){
16+
}
17+
18+
// executes before every test case
19+
function setup( currentMethod ){
20+
}
21+
22+
// executes after every test case
23+
function teardown( currentMethod ){
24+
}
25+
26+
/*********************************** TEST CASES BELOW ***********************************/
27+
28+
// Remember that test cases MUST have the keyword 'test' in them
29+
function myMethodTest(){
30+
31+
}
32+
33+
}
34+
]]></content>
35+
<tabTrigger>uniti</tabTrigger>
36+
<scope>source,text</scope>
37+
<description>TestBox xUnit Bundle With Inheritance</description>
38+
</snippet>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
function afterAll(){
4+
${0}
5+
});]]></content>
6+
<tabTrigger>afterall</tabTrigger>
7+
<scope>source,text</scope>
8+
<description>TestBox BDD After All</description>
9+
</snippet>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
afterEach(function( currentSpec ){
4+
${0}
5+
});]]></content>
6+
<tabTrigger>after</tabTrigger>
7+
<scope>source,text</scope>
8+
<description>TestBox BDD After Each</description>
9+
</snippet>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
function afterTests(){
4+
${0}
5+
});]]></content>
6+
<tabTrigger>aftertests</tabTrigger>
7+
<scope>source,text</scope>
8+
<description>TestBox xUnit After Tests</description>
9+
</snippet>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
function beforeAll(){
4+
${0}
5+
});]]></content>
6+
<tabTrigger>beforeall</tabTrigger>
7+
<scope>source,text</scope>
8+
<description>TestBox BDD Before All</description>
9+
</snippet>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
beforeEach(function( currentSpec ){
4+
${0}
5+
});]]></content>
6+
<tabTrigger>before</tabTrigger>
7+
<scope>source,text</scope>
8+
<description>TestBox BDD Before Each</description>
9+
</snippet>

0 commit comments

Comments
 (0)