View ttf.cfm
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
<style> | |
.tinytest {background-color: black; color:white; font-family:monospace} | |
.tinytest div {margin-left: 1em} | |
.tinyTest .pass {color:green;} | |
.tinyTest .fail {color:red;} | |
.tinyTest .error {background-color:red; color:black} | |
</style> | |
<cfscript> | |
tinyTest = { |
View testTinyTestFramework.cfm
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
<cfscript> | |
// tests | |
void function run() { | |
beforeAll(() => { | |
tinyTest.debug.setByBeforeAll = true | |
}) | |
describe("Tests of TinyTestFramework", () => { | |
describe("Tests of it", () => { | |
it("prefixes its message with ""It""", () => { |
View test.cfm
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
<cfscript> | |
i = 0 | |
f = 0.0 | |
d = createObject("java", "java.lang.Double").init(0) | |
writeDump([ | |
i = [ | |
i = i, | |
"i === i" = i === i, | |
"i.equals(i)" = i.equals(i), |
View test.cfm
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
<cfscript> | |
s1 = "ABCDEF".mid(1,3) | |
s2 = "DEFABC".mid(4,6) | |
writeOutput(s1 & "<br>") // ABC | |
writeOutput(s2 & "<br>") // ABC | |
writeOutput("<br>") | |
writeOutput((s1 == s2) & "<br>") // true | |
writeOutput((s1 === s2) & "<br>") // true (FALSE ON LUCEE) |
View AssertionsTest.cfc
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
import test.BaseSpec | |
component extends=BaseSpec { | |
function run() { | |
describe("Tests TestBox assertions", () => { | |
describe("Tests toThrow", () => { | |
it("should pass because it DOES throw an exception with the matching message", () => { | |
expect(() => throwExceptionWithMatchingMessage()).toThrow(regex="^.*MATCH_THIS.*$") | |
}) |
View luceeCfftpScopingBug.cfm
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
<cfscript> | |
serverDetails = { | |
server="ftp.dlptest.com", | |
username="dlpuser", | |
password="rNrKYTX9g7z3RgJRmxWuGHbeu" | |
} | |
function usingClassicMode() localmode="classic" { | |
cfftp(connection="c1", action="open", attributeCollection=serverDetails) | |
cfftp(connection="c2", action="open", attributeCollection=serverDetails, result="c2ConnectionResult") |
View CaptureStdOutTest.cfc
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
import test.BaseSpec | |
component extends=BaseSpec { | |
function run() { | |
describe("Trying to capture stdout", () => { | |
var fixtures = {} | |
aroundEach((spec) => { |
View BaseSpec.ccfc
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
// CHANGES ONLY | |
component { | |
// ... | |
// Setup Request Utilities | |
if ( !request.keyExists( "testbox" ) ) { | |
request.testbox = { | |
"console" : variables.console, | |
"debug" : () => debugFixed(argumentCollection=arguments, thisContext=this), // FIXED |
View Adam.cfc
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
component { | |
request.testBox.debug("in pseudo constructor") | |
static { | |
request.testBox.debug("in static constructor") | |
} | |
function init() { | |
request.testBox.debug("in constructor") |
View lifecycle_functions_spec.rb
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
describe "Lifecycle function tests" do | |
test_array = [] | |
before(:all) do | |
test_array.push "main block before :all handler" | |
end | |
before(:each) do # or just before with no param | |
test_array.push "main block before :each handler" | |
end |