Home

Awesome

AS3Unit

AS3Unit is a unit testing framework for ActionScript / Flash.

Installation

In order to use AS3Unit, you need the following installed on your system and in your ENV variable:

*extra step

If you have a 64-bit Java installation as your system's default, you need to do an extra step. Simply install a 32-bit version, and add the following line to flex_home/jvm.config:

java.home=location of your 32-bit java installation

Integrating with your project

Now, pull the latest version of AS3Unit's .git repo, and type this in the command line:

ruby build.rb

This will create a folder called flash-unit-release. You can place this folder in the root directory of your Flash project. In the same folder as flash-unit-release is where you should keep your test directory. To run your tests, enter the command line from your project's directory (if viewing the folder in Windows, a nice shortcut is Alt+D, type 'cmd', enter), and type:

ruby flash-unit-release/test.rb

Voila! Your browser will launch and the test results will be on display.

If you wish to keep the tool packaged in your project's repo, add these items to add to your .gitignore:

as3unit.swf
as3unit.js

Otherwise, add this:

as3unit-release/

Writing tests

Check out the tests for AS3Unit to get an idea of how to make a unit test in AS3Unit. A quick rundown:

Development

Want to contribute? Cool! I highly encourage a TDD approach for the development of this tool. If you wish to contribute by adding new features, do so in a TDD manner! :)

Todo's

License

Apache License, Version 2.0