Skip to content

Commit 834ec44

Browse files
committed
### v2.1.0
- Additions of `given-when-then` scripting for BDD - Additions of `story-feature` scripting for BDD - Fixes for `aroundEach` generation - Updated all syntax completions
1 parent a7e1738 commit 834ec44

15 files changed

+123
-10
lines changed

completions/ColdBox.sublime-completions

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
{ "trigger": "expect\tfn. (ColdBox BaseSpec)", "contents": "expect( actual=${1:any} )" },
2020
{ "trigger": "expectedException\tfn. (ColdBox BaseSpec)", "contents": "expectedException( type=${1:any}, regex=${2:any} )" },
2121
{ "trigger": "fail\tfn. (ColdBox BaseSpec)", "contents": "fail( message=${1:any} )" },
22+
{ "trigger": "feature\tfn. (ColdBox BaseSpec)", "contents": "feature( feature=\"${1:}\", body=${2:any}, labels=${3:any}, asyncAll=${4:true,false}, skip=${5:any} )" },
2223
{ "trigger": "getDebugBuffer\tfn. (ColdBox BaseSpec)", "contents": "getDebugBuffer()" },
2324
{ "trigger": "getMockBox\tfn. (ColdBox BaseSpec)", "contents": "getMockBox( generationPath=\"${1:}\" )" },
2425
{ "trigger": "getProperty\tfn. (ColdBox BaseSpec)", "contents": "getProperty( target=${1:any}, name=${2:any}, scope=${3:any}, defaultValue=${4:any} )" },
26+
{ "trigger": "given\tfn. (ColdBox BaseSpec)", "contents": "given( given=\"${1:}\", body=${2:any}, labels=${3:any}, asyncAll=${4:true,false}, skip=${5:any} )" },
2527
{ "trigger": "hasExpectedException\tfn. (ColdBox BaseSpec)", "contents": "hasExpectedException( specName=${1:any}, runner=${2:any} )" },
2628
{ "trigger": "isExpectedException\tfn. (ColdBox BaseSpec)", "contents": "isExpectedException( exception=${1:any}, specName=${2:any}, runner=${3:any} )" },
27-
{ "trigger": "it\tfn. (ColdBox BaseSpec)", "contents": "it( title=\"${1:}\", body=${2:any}, labels=${3:any}, skip=${4:any} )" },
29+
{ "trigger": "it\tfn. (ColdBox BaseSpec)", "contents": "it( title=\"${1:}\", body=${2:any}, labels=${3:any}, skip=${4:any}, data=${5:{}} )" },
2830
{ "trigger": "makePublic\tfn. (ColdBox BaseSpec)", "contents": "makePublic( target=${1:any}, method=\"${2:}\", newName=\"${3:}\" )" },
2931
{ "trigger": "prepareMock\tfn. (ColdBox BaseSpec)", "contents": "prepareMock( object=${1:any}, callLogging=${2:true,false} )" },
3032
{ "trigger": "print\tfn. (ColdBox BaseSpec)", "contents": "print( message=${1:any} )" },
@@ -36,8 +38,12 @@
3638
{ "trigger": "runRemote\tfn. (ColdBox BaseSpec)", "contents": "runRemote( testSpecs=\"${1:}\", testSuites=\"${2:}\", reporter=\"${3:}\", labels=\"${4:}\" )" },
3739
{ "trigger": "runSpec\tfn. (ColdBox BaseSpec)", "contents": "runSpec( spec=${1:any}, suite=${2:any}, testResults=${3:any}, suiteStats=${4:any}, runner=${5:any} )" },
3840
{ "trigger": "runTestMethod\tfn. (ColdBox BaseSpec)", "contents": "runTestMethod( spec=${1:any}, testResults=${2:any}, suiteStats=${3:any}, runner=${4:any} )" },
41+
{ "trigger": "scenario\tfn. (ColdBox BaseSpec)", "contents": "scenario( scenario=\"${1:}\", body=${2:any}, labels=${3:any}, asyncAll=${4:true,false}, skip=${5:any} )" },
42+
{ "trigger": "story\tfn. (ColdBox BaseSpec)", "contents": "story( story=\"${1:}\", body=${2:any}, labels=${3:any}, asyncAll=${4:true,false}, skip=${5:any} )" },
43+
{ "trigger": "then\tfn. (ColdBox BaseSpec)", "contents": "then( then=\"${1:}\", body=${2:any}, labels=${3:any}, skip=${4:any}, data=${5:{}} )" },
44+
{ "trigger": "when\tfn. (ColdBox BaseSpec)", "contents": "when( when=\"${1:}\", body=${2:any}, labels=${3:any}, asyncAll=${4:true,false}, skip=${5:any} )" },
3945
{ "trigger": "xdescribe\tfn. (ColdBox BaseSpec)", "contents": "xdescribe( title=\"${1:}\", body=${2:any}, labels=${3:any}, asyncAll=${4:true,false} )" },
40-
{ "trigger": "xit\tfn. (ColdBox BaseSpec)", "contents": "xit( title=\"${1:}\", body=${2:any}, labels=${3:any} )" },
46+
{ "trigger": "xit\tfn. (ColdBox BaseSpec)", "contents": "xit( title=\"${1:}\", body=${2:any}, labels=${3:any}, data=${4:{}} )" },
4147
{ "trigger": "appendToBuffer\tfn. (ColdBox Interceptor)", "contents": "appendToBuffer( str=${1:any} )" },
4248
{ "trigger": "clearBuffer\tfn. (ColdBox Interceptor)", "contents": "clearBuffer()" },
4349
{ "trigger": "getBufferObject\tfn. (ColdBox Interceptor)", "contents": "getBufferObject()" },
@@ -225,6 +231,7 @@
225231
{ "trigger": "binder.unMap\tfn. (ColdBox binder)", "contents": "unMap( name=${1:any} )" },
226232
{ "trigger": "binder.virtualInheritance\tfn. (ColdBox binder)", "contents": "virtualInheritance( mapping=${1:any} )" },
227233
{ "trigger": "binder.with\tfn. (ColdBox binder)", "contents": "with( alias=${1:any} )" },
234+
{ "trigger": "binder.withInfluence\tfn. (ColdBox binder)", "contents": "withInfluence( influenceClosure=${1:any} )" },
228235
// END Functions for Scope: binder
229236

230237
// Functions for Scope: log

readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,16 @@ Code completion for all major ColdBox + TestBox functions and scopes:
7373
- `expectFalse ➝` : Does a false expectation expression
7474
- `expectTrue ➝` : Does a true expectation expression
7575
- `expectToThrow ➝` : Starts an expectation that throws an exception
76+
- `feature, featureFull ➝` : Starts a `feature()` block
77+
- `given, givenFull ➝` : Starts a `given()` block
7678
- `it ➝` : A test spec
7779
- `itFull ➝` : A test spec with all arguments
7880
- `setup ➝` : An `setup()` xUnit life-cycle method
81+
- `story, storyFull ➝` : Starts a `story()` block
7982
- `teardown ➝` : An `teardown()` xUnit life-cycle method
83+
- `then, thenFull ➝` : Starts a `then()` block
8084
- `unit ➝` : Creates a new xUnit Test Bundle CFC
85+
- `when, whenFull ➝` : Starts a `when()` block
8186

8287
### ColdBox Testing Snippets
8388

@@ -131,6 +136,12 @@ If you have the [Package Control](http://wbond.net/sublime_packages/package_cont
131136

132137
## Changelog
133138

139+
### v2.1.0
140+
- Additions of `given-when-then` scripting for BDD
141+
- Additions of `story-feature` scripting for BDD
142+
- Fixes for `aroundEach` generation
143+
- Updated all syntax completions
144+
134145
### v2.0.0
135146
- ColdBox 4 additions/modifications
136147

skeletons/box.json.sublime-snippet

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@
2727
"private":false,
2828
"engines":[
2929
{
30-
"type":"railo",
31-
"version":">=4.1.x"
32-
},
33-
{
34-
"type":"adobe",
35-
"version":">=10.0.0"
30+
"type":"",
31+
"version":""
3632
}
3733
],
3834
"defaultEngine":"",

snippets/handlers/action.sublime-snippet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
/**
44
* ${1:index}
55
*/
6-
any function ${1:index}( event, rc, prc ){
6+
function ${1:index}( event, rc, prc ){
77
${0}
8-
event.setView("${TM_FILENAME/\.cfm//}/${1}");
8+
event.setView( "${TM_FILENAME/\.cfm//}/${1}" );
99
}
1010
]]></content>
1111
<tabTrigger>action</tabTrigger>

snippets/testbox/aroundeach.sublime-snippet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<content><![CDATA[
33
aroundEach(function( spec, suite ){
44
${0}
5+
arguments.spec.body();
56
});]]></content>
67
<tabTrigger>around</tabTrigger>
78
<scope>source,text</scope>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<content><![CDATA[
3+
feature( "${1:A suite}", function(){
4+
${0}
5+
6+
});]]></content>
7+
<tabTrigger>feature</tabTrigger>
8+
<scope>source,text</scope>
9+
<description>TestBox BDD Feature</description>
10+
</snippet>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<content><![CDATA[
3+
feature( title="${1:A suite}", labels="", asyncAll=false, skip=false, body=function(){
4+
${0}
5+
6+
});]]></content>
7+
<tabTrigger>featureFull</tabTrigger>
8+
<scope>source,text</scope>
9+
<description>TestBox BDD Feature With Arguments</description>
10+
</snippet>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<content><![CDATA[
3+
given( "${1:A suite}", function(){
4+
${0}
5+
6+
});]]></content>
7+
<tabTrigger>given</tabTrigger>
8+
<scope>source,text</scope>
9+
<description>TestBox BDD Given</description>
10+
</snippet>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<content><![CDATA[
3+
given( title="${1:A suite}", labels="", asyncAll=false, skip=false, body=function(){
4+
${0}
5+
6+
});]]></content>
7+
<tabTrigger>givenFull</tabTrigger>
8+
<scope>source,text</scope>
9+
<description>TestBox BDD Given With Arguments</description>
10+
</snippet>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<content><![CDATA[
3+
story( "${1:A suite}", function(){
4+
${0}
5+
6+
});]]></content>
7+
<tabTrigger>story</tabTrigger>
8+
<scope>source,text</scope>
9+
<description>TestBox BDD Story</description>
10+
</snippet>

0 commit comments

Comments
 (0)