Last active
January 1, 2016 07:19
-
-
Save adamcameron/8111064 to your computer and use it in GitHub Desktop.
Demonstrating different between an erroring beforeTests() and an erroring setup()
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
// Application.cfc | |
component { | |
this.mappings = { | |
"/testbox" = expandPath("/frameworks/testbox/"), | |
"/mxunit" = expandPath("/frameworks/testbox/system/testing/compat"), | |
"/unittests" = expandPath("/shared/git/blogExamples/unittests") | |
}; | |
} |
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
<!--- runTests.cfm ---> | |
<cfoutput> | |
#createObject("mxunit.runner.DirectoryTestSuite").run( | |
directory = getDirectoryFromPath(getCurrentTemplatePath()), | |
componentPath = "unittests.testbox.beforeTests", | |
recurse = false | |
).getResultsOutput("simple")# | |
</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
// TestBeforeTests.cfc | |
component extends="mxunit.framework.TestCase" { | |
public void function beforeTests(){ | |
throw(type="TestException", message="An error in beforeTests() just errors out"); | |
} | |
} |
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
//TestSetup.cfc | |
component extends="mxunit.framework.TestCase" { | |
public void function setup(){ | |
throw(type="TesTException", message="An error in setup() is handled gracefully"); | |
} | |
public void function testSetup(){ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment