-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
78 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tests/testbox |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"devDependencies":{ | ||
"testbox":"^4.0.0" | ||
}, | ||
"installPaths":{ | ||
"testbox":"tests/testbox/" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,7 @@ version: "3" | |
|
||
services: | ||
calc_app: | ||
build: app/ | ||
#image: foundeo/minibox:latest | ||
#command: ["box", "server", "start", "port=8847", "[email protected]", "--console"] | ||
build: ./ | ||
ports: | ||
- "8855:8855" | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name":"calc", | ||
"web":{ | ||
"http":{ | ||
"port":"8855" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ component { | |
|
||
remote function add(x, y) { | ||
return x+y; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
component { | ||
this.name = "calcTests"; | ||
|
||
this.mappings = { | ||
"/testbox" = getDirectoryFromPath(getCurrentTemplatePath()) & "testbox", | ||
"/specs" = getDirectoryFromPath(getCurrentTemplatePath()) & "specs" | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<cfset calc = new services.calc()> | ||
|
||
<cfset result = calc.add(5,3)> | ||
|
||
<cfif result EQ 8> | ||
PASS: Result was 8 | ||
<cfelse> | ||
Fail: Result was: <cfoutput>#encodeForHTML(result)#</cfoutput> | ||
<cfheader statuscode="500" statustext="Fail"> | ||
</cfif> | ||
|
||
<!--- this works but there are better ways to write tests ---> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
#run a simple curl test of our API | ||
echo "\nRUNNING SIMPLE CFML TEST SUITE:\n" | ||
|
||
http_code=$(curl --verbose -s -o /tmp/cfm-result.txt -w '%{http_code}' "http://127.0.0.1:8855/tests/cfm/test.cfm";) | ||
|
||
cat /tmp/cfm-result.txt | ||
|
||
if [ "$http_code" -eq "200" ]; then | ||
echo "\nPASS: HTTP Status Code was 200" | ||
else | ||
echo "\nFAIL: Status Code: $http_code" | ||
exit 1 | ||
fi |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<cfparam name="reporter" default="html"> | ||
<cfset r = new testbox.system.TestBox( directory="specs", reporter=reporter, verbose=true) > | ||
<cfoutput>#r.run()#</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
component extends="testbox.system.BaseSpec" { | ||
|
||
function run(testResults, testBox) { | ||
|
||
describe("Test Addition", function() { | ||
it("Should be able to add two positive integers", function() { | ||
var calc = new services.calc(); | ||
expect(calc.add(5,3)).toBe(8); | ||
}); | ||
|
||
it("Should be able to add negative integers", function() { | ||
var calc = new services.calc(); | ||
expect(calc.add(-6,3)).toBe(-3); | ||
}); | ||
}); | ||
} | ||
|
||
} |
File renamed without changes.