{"id":13744119,"url":"https://github.com/dbackeus/leanunit-actionscript2","last_synced_at":"2026-02-28T15:32:21.718Z","repository":{"id":431297,"uuid":"51782","full_name":"dbackeus/leanunit-actionscript2","owner":"dbackeus","description":"Sweet and lean unit test framework for actionscript 2.0","archived":false,"fork":false,"pushed_at":"2008-09-13T21:17:00.000Z","size":112,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T05:20:51.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbackeus.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-09-11T21:18:00.000Z","updated_at":"2019-08-13T13:34:51.000Z","dependencies_parsed_at":"2022-07-14T13:00:51.796Z","dependency_job_id":null,"html_url":"https://github.com/dbackeus/leanunit-actionscript2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dbackeus/leanunit-actionscript2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackeus%2Fleanunit-actionscript2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackeus%2Fleanunit-actionscript2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackeus%2Fleanunit-actionscript2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackeus%2Fleanunit-actionscript2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbackeus","download_url":"https://codeload.github.com/dbackeus/leanunit-actionscript2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackeus%2Fleanunit-actionscript2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29940284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:01:03.370Z","updated_at":"2026-02-28T15:32:21.679Z","avatar_url":"https://github.com/dbackeus.png","language":"ActionScript","readme":"= LeanUnit\n\n* http://github.com/dbackeus/leanunit-actionscript2\n\n== THE STORY\n\nAfter wasting too much time trying to figure out ASUnit and feeling sick about how bloated its codebase was I decided to roll my own. This is the result.\n\nNote: I later realized I had been looking only at asunit2 when I should have been looking at the refactored and better looking asunit25. That said asunit25 still looks like Java and Actionscript is not Java. LeanUnit is a whole lot leaner and to the point if you'll pardon my shameless self promotion.\n\n== REQUIREMENTS\n\nA flash compiler. Example files are provided for Flash 8 and MTASC.\n\n== INSTALL\n\nIf you don't have git you can get the files by using the download link at the github homepage. Otherwise just clone them from git.\n\n  git clone git://github.com/druiden/leanunit-actionscript2.git\n\nThen either copy the leanUnit directory into your actionscript project source directory or link the cloned directory in your fla classpath (publish settings -\u003e flash -\u003e settings).\n\n== USAGE\n\nAfter installing, the first thing you need to do is create a test case class with the tests you want to run. If you don't feel like starting from scratch just to see how it works you can go ahead and checkout the 'example' directory.\n\n=== Naming Conventions\n\nThere are some conventions for how you name your test classes and where you put them.\n\n* They should reside in a 'test' directory relative to your projects source directory.\n* They should start with the name of the class you want to test.\n* They should end with Test.as. \n\nSo if you're making a test class for your Person class you would create test/PersonTest.as. You are not forced to follow the conventions but I strongly recommend it to keep things nice and structured. \n\n=== Structure of the Test Class\n\nSo now that your newly created test class looks good from the outside. What to make of the inside.\n\n* All test classes must inherit from leanUnit.TestCase\n* All test functions must start with 'test'\n* You can add a setup function that will be run before every test function\n* You can add a teardown functino that will be run after every test function\n\nThe following is an example of a test class for String.\n\n  // test/StringTest.as\n  \n  class test.StringTest extends leanUnit.TestCase\n  {\n  \tvar string:String\n\t\n  \tfunction setup()\n  \t{\n  \t\tstring = 'Asdf'\n  \t}\n\t\n  \tfunction testLength()\n  \t{\n  \t\tassertEqual(4, string.length)\n  \t}\n\t\n  \tfunction testToUpperCase()\n  \t{\n  \t\tassertEqual( 'ASDF', string.toUpperCase() )\n  \t}\n\t\n  \tfunction teardown()\n  \t{\n  \t\tdelete string\n  \t}\n  }\n\nWhen your test class is created you can run it by adding it to a test suite call run on the suite instance.\n\n=== Using the Flash IDE\n\nAdd code for running your test class in the framescript of the .fla, like:\n\n  import leanUnit.*\n  import test.*\n  \n  new TestSuite( StringTest ).run()  \n\nThen export the .fla and watch the results.\n\n=== Using the MTASC compiler\n\nCreate an .as file to be the entry point for the compiler:\n\n  // MtascMain.as\n  \n  import leanUnit.*\n  import test.*\n  \n  class MtascMain\n  {\n  \tstatic function main(root)\n  \t{\n  \t\tvar suite = new TestSuite( StringTest )\n  \t\tsuite.run()\n  \t}\n  }\n\nThen compile from the command line using something like:\n\n  mtasc -swf test/example.swf -header 550:400:10:080808 -main MtascMain.as\n\nNow you can run the generated .swf through Flash Player or from your webbrowser and watch the results.\n\n=== Running Multiple Test Cases\n\nYou can add any number of test cases you want to run to your test suite before running it. TestSuite extends Array so you can work with it just like an array.\n\n  import leanUnit.*\n  import test.*\n\n  // The horisontal way\n  var suite = new TestSuite( StringTest, ArrayTest )\n  suite.run()\n  \n  // The vertical way\n  var suite = new TestSuite()\n  suite.push( StringTest )\n  suite.push( ArrayTest )\n  suite.run()\n\n  // The oldschool way\n  var suite = new TestSuite()\n  suite[0] = StringTest\n  suite[1] = ArrayTest\n  suite.run()\n\n== LICENSE\n\n(The MIT License)\n\nCopyright (c) 2008 David Backéus\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["Frameworks"],"sub_categories":["Unit Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackeus%2Fleanunit-actionscript2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbackeus%2Fleanunit-actionscript2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackeus%2Fleanunit-actionscript2/lists"}