Skip to content

Instantly share code, notes, and snippets.

View newtriks's full-sized avatar

Simon Bailey newtriks

View GitHub Profile
package
{
import flash.display.DisplayObject;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.ui.Keyboard;
import mx.controls.PopUpButton;
@newtriks
newtriks / gist:1016612
Created June 9, 2011 12:09
Run command with rake test
task :default => :list do
%x{touch readme.txt}
end
task :list do
@dump=%x{ls}
puts "Directory contents: #{@dump}"
end
@newtriks
newtriks / FlexTestRunner.mxml
Created June 10, 2011 15:35
Flex ASUnit4 TestRunner
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
minWidth="800"
minHeight="600"
creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import asunit.core.TextCore;
@newtriks
newtriks / AllTests.as
Created June 10, 2011 15:43
ASUnit4 Test Suite class
package
{
[Suite]
public class AllTests
{
}
}
@newtriks
newtriks / SearchViewTest.as
Created June 13, 2011 11:37
SearchView Test Class using ASUnit4
/** @author: Simon Bailey <[email protected]> */
package
{
import asunit.asserts.assertNotNull;
import asunit.asserts.assertSame;
import asunit.asserts.assertTrue;
import asunit.framework.IAsync;
import flash.display.Sprite;
import flash.events.Event;
@newtriks
newtriks / SearchView.mxml
Created June 13, 2011 11:44
SearchView MXML component used by ASUnit4 test example
<?xml version="1.0"?>
<s:Group xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fx="http://ns.adobe.com/mxml/2009">
<fx:Metadata>
[Event(name='submitSearchEvent',type='flash.events.Event')]
</fx:Metadata>
<s:layout>
<s:HorizontalLayout paddingLeft="10"
paddingRight="10"
paddingBottom="10"
@newtriks
newtriks / ExampleComponentUsage.mxml
Created July 28, 2011 21:49
Fluent snippets example usage in a Flex project. Configuration is set via mxml params which are then used to build a strongly typed Object in a Fluent fashion.
<media:MediaContainer id="mediaContainer"
aspectRatio="{VideoBase.WIDE_SCREEN}"
verticalCenter="0"
horizontalCenter="0"
bandwidth="32768"
logHandler="{log}"
layoutHandler="{resize}"/>
@newtriks
newtriks / gist:1139788
Created August 11, 2011 14:31
Preparing Mockolate example in an ASUnit4 TestCase
[Inject]
public var async:IAsync;
[Before]
public function prepareMockolates():void
{
var mockolateMaker:IEventDispatcher=prepare(IModuleStore);
async.proceedOnEvent(mockolateMaker, Event.COMPLETE, 5000);
}
@newtriks
newtriks / gator.rb
Created August 15, 2011 21:30
Gator config file
require "gator/as3/generators"
require "gator/as3/generators/test/asunit4"
require "gator/as3/robotlegs/generators"
require "gator/as3/robotlegs/generators/test/asunit4"
project Gator::Project::ProjectBase.new
project.name = "MyProject"
project.options[:authors] = ["newtriks"]
project.layout[:source,:main,:as3] = "src"
project.layout[:source,:test,:as3] = "test"
@newtriks
newtriks / gator.rb
Created September 1, 2011 09:42
Includes to use source instead of gem
require "/Users/newtriks/Development/libs/gator-as3/lib/gator/as3/generators/"
require "/Users/newtriks/Development/libs/gator-as3/lib/gator/mxml/generators/"
require "/Users/newtriks/Development/libs/gator-as3/lib/gator/as3/generators/test/asunit4"
require "gator/as3/robotlegs/generators"
require "gator/mxml/robotlegs/generators"
require "gator/as3/robotlegs/generators/test/asunit4"