{"id":13744129,"url":"https://github.com/f1337/as3spec","last_synced_at":"2025-05-09T02:32:41.935Z","repository":{"id":593854,"uuid":"228675","full_name":"f1337/as3spec","owner":"f1337","description":"A tiny BDD framework for AS3, inspired by Bacon and RSpec","archived":false,"fork":false,"pushed_at":"2010-01-14T18:44:21.000Z","size":1220,"stargazers_count":20,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-15T15:42:13.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"robertabcd/goamf","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f1337.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-06-16T15:13:11.000Z","updated_at":"2021-12-17T15:35:24.000Z","dependencies_parsed_at":"2022-07-07T14:21:23.971Z","dependency_job_id":null,"html_url":"https://github.com/f1337/as3spec","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1337%2Fas3spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1337%2Fas3spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1337%2Fas3spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f1337%2Fas3spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f1337","download_url":"https://codeload.github.com/f1337/as3spec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253177839,"owners_count":21866405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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.551Z","updated_at":"2025-05-09T02:32:41.701Z","avatar_url":"https://github.com/f1337.png","language":"ActionScript","readme":"==== NEW SYNTAX BELOW!\n\nIf running the specs for AS3Spec itself, you should get:\n\n\"33 specifications, 1 failures, 2 errors, 1 timeouts, 1 missing\" in the summary - this is currently correct.\n\n= AS3Spec \n\nAS3Spec is a tiny BDD framework for AS3, inspired by Bacon and RSpec. Built upon sprout project-generation tool for ActionScript/Flash/Flex/AIR.\n\n== Quick Start\n\n=== Install Ruby, RubyGems\n\n==== Windows\n\nThe One-Click Ruby Installer for Windows provides Ruby and RubyGems:\nhttp://rubyinstaller.rubyforge.org/\n\n==== OSX 10.5 (Leopard)\n\nThe developer tools included with Xcode installer provide\nRuby and RubyGems: http://developer.apple.com/technology/xcode.html\n\n==== OSX 10.4 (Tiger), 10.3 (Panther)\n\nThe Ruby One-Click Installer for OSX provides Ruby and RubyGems:\nhttp://rubyosx.rubyforge.org/\n\n==== Other operating systems\n\nRuby installation instructions for other platforms are availabe at: http://www.ruby-lang.org/en/downloads/\n\nRubyGems installation instructions for other platforms are availabe at: http://docs.rubygems.org/read/chapter/3\n\n=== Install Sprouts\n\nOpen your favorite terminal emulator (PuTTY, Terminal, etc.):\n\n  $ sudo gem install sprout\n\nDOS/Windows users do not enter sudo\n\n=== Sprout a project\n\nFrom http://projectsprouts.org/:\n\n  $ sprout -n as3 SomeProject\n  $ cd SomeProject\n  $ rake\n\nWindows users may have to run:\n\n  $ script\\generate.rb utils.MathUtil\n\n=== Why Sprouts?\n\nThere is a well written answer to that question at http://www.projectsprouts.org. I'm not going to copy the *entire* Sprouts manual here. ;)\n\n=== Generators\n\nAS3Spec provides some custom generators for Sprouts. Copy the generators directory to your Sprouts project, then use the generators as described below.\n\n  $ script/generate world.Hello\n        create  src/world\n        create  src/world/Hello.as\n        create  spec/world\n        create  spec/world/HelloSpec.as\n     identical  spec/SpecSuite.as\n     identical  spec/SpecSuiteXML.as\n  $ script/generate spec world.Hello\n        exists  spec/world\n     identical  spec/world/HelloSpec.as\n     identical  spec/SpecSuite.as\n     identical  spec/SpecSuiteXML.as\n  $ script/generate suite\n     identical  spec/SpecSuite.as\n     identical  spec/SpecSuiteXML.as\n  $ rake spec\n\n\n== Now we can BDD in AS3 (NEW SYNTAX!)\n\n\n  package\n  {\n    import as3spec.*;\n    import flash.utils.*;\n    import flash.events.*;\n    \n    \n    public class AS3Specs extends Spec\n    {\n      private var nothing:String;\n      private var arr:Array;\n      private var myTimer1:Timer;\n      private var myTimer2:Timer;\n      private var myTimer3:Timer;\n      private var myTimer4:Timer;\n      private var myObject:Object;\n      \n      override public function before():void\n      {\n        arr=new Array;\n        myTimer1=new Timer(1000, 1);\n        myTimer2=new Timer(1000, 1);\n        myTimer3=new Timer(1000, 1);\n        myTimer4=new Timer(1000, 1);\n        myObject={};\n      }\n      \n      \n      \n      override public function after():void\n      {\n        myTimer1.stop();\n        myTimer2.stop();\n        myTimer3.stop();\n      }\n      \n      override public function run () :void\n      {\n        \n        describe ('as3spec', function () :void\n        {\n            \n            it ('provides should.equal').so(23).should.equal(23);\n            it ('provides should.not.equal').so(23).should.not.equal(12);\n            it ('provides should.be.same').so(arr).should.be.same_as(arr);\n            it ('provides should.not.be.same').so(arr).should.not.be.same_as((new Array));\n            it ('provides should.be.nil').so(nothing).should.be.nil;\n            it ('provides should.not.be.nil').so(arr).should.not.be.nil;\n            it ('provides should.have').so(arr).should.have('length');\n            it ('provides should.not.have').so(arr).should.not.have('kittens');\n            it ('provides should.match').so('hello').should.match(/ell/);\n            it ('provides should.not.match').so('hello').should.not.match(/egg/);\n            it ('provides should.be.a.kind_of').so(arr).should.be.a.kind_of(Array);\n            it ('provides should.not.be.a.kind_of').so(arr).should.not.be.a.kind_of(Boolean);\n            \n            it ('provides should.raise(message)')\n              .so(function() :void\n              {\n                throw('an error');\n              })\n              .should.raise('an error');\n              \n            it ('provides should.not.raise(message)')\n              .so(function() :void\n              {\n                //nothing here\n              })\n              .should.not.raise('an error');\n              \n            it ('provides should.raise(class)')\n              .so(function () :void\n              {\n                throw(new Error('an error'));\n              })\n              .should.raise(Error);\n              \n            it('provides should.not.raise(class)')\n              .so(function () :void\n              {\n                // do nothing\n              })\n              .should.not.raise(Error);\n              \n            it ('provides should.raise()')\n              .so(function () :void\n              {\n                throw(new Error('an error'));\n              }).should.raise();\n              \n            it ('provides should.not.raise()')\n              .so(function () :void\n              {\n                // do nothing\n              }).should.not.raise();\n              \n            it ('provides should.not.trigger')\n              .so(myTimer1).should.not.trigger('timer');\n              \n            it ('provides should.trigger', function() :void\n              {\n                myTimer1.addEventListener('timer', function(t:*) : void {});\n              })\n              .so(myTimer1).should.trigger('timer');\n            \n            \n            it ('provides after(time).second', function() :void\n              {\n                setTimeout(function(t:*=null) :void{ myObject.myVal=5234 }, 900);\n              })\n              .so(myObject, 'myVal')\n              .after(1).second\n              .should.equal(5234);\n              \n            it ('provides after(time).seconds', function() :void\n              {\n                setTimeout(function(t:*=null) :void{ myObject.myVal=2255 }, 300);\n              })\n              .so(myObject, 'myVal')\n              .after(0.5).seconds\n              .should.equal(2255);\n            \n            it('provides when.receiving(event)', function() :void\n              {\n                myTimer2.start();\n              })    \n              .so(myTimer2)\n              .when.receiving(TimerEvent.TIMER)\n              .should.be.same_as(myTimer2);\n                \n              \n            it('provides when.receiving(event).from(object)', function() :void\n              {\n                myTimer3.start();\n              })    \n              .so(123)\n              .when.receiving(TimerEvent.TIMER).from(myTimer3)\n              .should.be.equal_to(123);\n              \n            it('catches a missing spec');\n  \n            var arbitraryArg:String = 'dont be this';\n  \n            it('takes arbitrary arguments to specify block and can take a method to evaluate(run) in require', function(arbArg:String) :void\n              {\n                arbitraryArg=arbArg;\n              },\n              'please be this')\n              .so(function() : Boolean {\n                return (arbitraryArg == 'please be this');\n              })\n              .should.give(true);\n              \n            it('should generate an error if block passed to require throws')    \n              .so(function() : Boolean {\n                var someObject:*;\n                return someObject.nonExistant();\n              })\n              .should.give(true);\n              \n            it ('catches an error', function () :void\n              {\n                throw(new Error('catch me if you can!'));\n              }).so(arr);\n              \n            it ('catches a failure')\n              .so(23).should.equal(15);\n            \n            timeout = 500;\n            it ('can time out', function() :void\n              {\n                myTimer4.start();\n              })\n              .so(123)\n              .when.receiving(TimerEvent.TIMER).from(myTimer4)\n              .should.be.equal_to(123);\n              \n              \n        });\n        \n        \n      }\n      \n    }\n  }","funding_links":[],"categories":["Frameworks"],"sub_categories":["Unit Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff1337%2Fas3spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff1337%2Fas3spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff1337%2Fas3spec/lists"}