gator-as3 0.0.7.pre → 0.0.9.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +3 -2
- data/Rakefile +7 -4
- data/VERSION +1 -1
- data/gator-as3.gemspec +73 -28
- data/lib/gator/as3.rb +3 -0
- data/lib/gator/as3/as3_configuration.rb +38 -0
- data/lib/gator/as3/generators/{collection.rb → as3/collection.rb} +5 -1
- data/lib/gator/as3/generators/as3/event.rb +14 -0
- data/lib/gator/as3/generators/as3/generator.rb +95 -0
- data/lib/gator/as3/generators/as3/interface.rb +14 -0
- data/lib/gator/as3/generators/as3/klass.rb +15 -0
- data/lib/gator/as3/generators/as3/test/asunit3.rb +3 -0
- data/lib/gator/as3/generators/as3/test/asunit3/collection.rb +21 -0
- data/lib/gator/as3/generators/as3/test/asunit3/klass.rb +32 -0
- data/lib/gator/as3/generators/as3/test/asunit3/runner.rb +28 -0
- data/lib/gator/as3/generators/as3/test/asunit3/suite.rb +38 -0
- data/lib/gator/as3/generators/{test → as3/test}/asunit4.rb +0 -0
- data/lib/gator/as3/generators/{test → as3/test}/asunit4/collection.rb +5 -1
- data/lib/gator/as3/generators/as3/test/asunit4/klass.rb +31 -0
- data/lib/gator/as3/generators/as3/test/asunit4/runner.rb +29 -0
- data/lib/gator/as3/generators/as3/test/asunit4/suite.rb +39 -0
- data/lib/gator/as3/generators/{test → as3/test}/flexunit4.rb +0 -0
- data/lib/gator/as3/generators/{test → as3/test}/flexunit4/collection.rb +1 -1
- data/lib/gator/as3/generators/as3/test/flexunit4/klass.rb +34 -0
- data/lib/gator/as3/generators/mxml/application.rb +16 -0
- data/lib/gator/as3/generators/mxml/collection.rb +20 -0
- data/lib/gator/as3/generators/mxml/component.rb +16 -0
- data/lib/gator/as3/generators/mxml/generator.rb +20 -0
- data/lib/gator/as3/generators/mxml/skin.rb +21 -0
- data/lib/gator/as3/templates/as3/event.as.tt +12 -0
- data/lib/gator/as3/templates/as3/interface.as.tt +6 -0
- data/lib/gator/as3/{generators → templates/as3}/klass.as.tt +0 -0
- data/lib/gator/as3/templates/as3/test/asunit3/klass.as.tt +37 -0
- data/lib/gator/as3/templates/as3/test/asunit3/runner.as.tt +13 -0
- data/lib/gator/as3/templates/as3/test/asunit3/suite.as.tt +17 -0
- data/lib/gator/as3/{generators → templates/as3}/test/asunit4/klass.as.tt +0 -0
- data/lib/gator/as3/templates/as3/test/asunit4/runner.as.tt +17 -0
- data/lib/gator/as3/templates/as3/test/asunit4/suite.as.tt +14 -0
- data/lib/gator/as3/{generators → templates/as3}/test/flexunit4/klass.as.tt +0 -0
- data/lib/gator/as3/templates/mxml/application.mxml.tt +30 -0
- data/lib/gator/as3/templates/mxml/component.mxml.tt +13 -0
- data/lib/gator/as3/templates/mxml/skin.mxml.tt +53 -0
- data/lib/gator/mxml/generators.rb +5 -0
- data/lib/gator/utils/as3_util.rb +45 -0
- data/rake/jeweler.rb +17 -0
- data/rake/jeweler_prerelease_tasks.rb +50 -0
- data/rake/pre_release_gemspec.rb +80 -0
- data/rake/pre_release_to_git.rb +59 -0
- data/spec/as3/generators/collection_spec.rb +46 -0
- data/spec/as3/generators/event_spec.rb +40 -0
- data/spec/as3/generators/interface_spec.rb +40 -0
- data/spec/as3/generators/klass_spec.rb +40 -0
- data/spec/as3/generators/test/asunit3/klass_spec.rb +43 -0
- data/spec/as3/generators/test/asunit3/runner_spec.rb +43 -0
- data/spec/as3/generators/test/asunit3/suite_spec.rb +43 -0
- data/spec/as3/generators/test/asunit4/klass_spec.rb +43 -0
- data/spec/as3/generators/test/asunit4/runner_spec.rb +43 -0
- data/spec/as3/generators/test/asunit4/suite_spec.rb +43 -0
- data/spec/mxml/generators/application_spec.rb +42 -0
- data/spec/mxml/generators/component_spec.rb +42 -0
- data/spec/mxml/generators/skin_spec.rb +42 -0
- data/spec/spec_helper.rb +36 -3
- metadata +86 -35
- data/lib/gator/as3/generators.rb +0 -3
- data/lib/gator/as3/generators/klass.rb +0 -53
- data/lib/gator/as3/generators/test/asunit4/klass.rb +0 -61
- data/lib/gator/as3/generators/test/flexunit4/klass.rb +0 -57
- data/spec/generators/collection_spec.rb +0 -11
- data/spec/generators/klass_spec.rb +0 -5
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Gator::AS3::InterfaceGenerator do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:each) do
|
10
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should create a file in the correct location" do
|
14
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
15
|
+
gator.should_receive(:fork) do |&block|
|
16
|
+
block.call
|
17
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
18
|
+
Gator::AS3::InterfaceGenerator.start("org.devboy.MyShinyClass".split(" "))
|
19
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :main, :as3), "org/devboy/MyShinyClass.as")).should == true
|
20
|
+
end
|
21
|
+
gator.run_with_default_mock
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should have the correct values" do
|
25
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
26
|
+
gator.should_receive(:fork) do |&block|
|
27
|
+
block.call
|
28
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
29
|
+
generator = Gator::AS3::InterfaceGenerator.new("org.devboy.MyShinyClass".split(" "))
|
30
|
+
generator.invoke_all
|
31
|
+
generator.package_name.should == "org.devboy"
|
32
|
+
generator.class_name.should == "MyShinyClass"
|
33
|
+
generator.template_file.should == "as3/interface.as.tt"
|
34
|
+
|
35
|
+
end
|
36
|
+
gator.run_with_default_mock
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Gator::AS3::ClassGenerator do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:each) do
|
10
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should create a file in the correct location" do
|
14
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
15
|
+
gator.should_receive(:fork) do |block|
|
16
|
+
block.call
|
17
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
18
|
+
Gator::AS3::ClassGenerator.start("org.devboy.MyShinyClass".split(" "))
|
19
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :main, :as3), "org/devboy/MyShinyClass.as")).should == true
|
20
|
+
end
|
21
|
+
gator.run_with_default_mock
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should have the correct values" do
|
25
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
26
|
+
gator.should_receive(:fork) do |block|
|
27
|
+
block.call
|
28
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
29
|
+
generator = Gator::AS3::ClassGenerator.new("org.devboy.MyShinyClass".split(" "))
|
30
|
+
generator.invoke_all
|
31
|
+
generator.package_name.should == "org.devboy"
|
32
|
+
generator.class_name.should == "MyShinyClass"
|
33
|
+
generator.template_file.should == "as3/klass.as.tt"
|
34
|
+
|
35
|
+
end
|
36
|
+
gator.run_with_default_mock
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
3
|
+
|
4
|
+
describe Gator::AS3::ASUnit3::ClassTestGenerator do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should create a file in the correct location" do
|
15
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
16
|
+
gator.should_receive(:fork) do |&block|
|
17
|
+
block.call
|
18
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
19
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
20
|
+
Gator::AS3::ASUnit3::ClassTestGenerator.start("org.devboy.MyShinyClass".split(" "))
|
21
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :test, :as3), "org/devboy/MyShinyClassTest.as")).should == true
|
22
|
+
end
|
23
|
+
gator.run_with_default_mock
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have the correct values" do
|
27
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
28
|
+
gator.should_receive(:fork) do |&block|
|
29
|
+
block.call
|
30
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
31
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
32
|
+
generator = Gator::AS3::ASUnit3::ClassTestGenerator.new("org.devboy.MyShinyClass".split(" "))
|
33
|
+
generator.invoke_all
|
34
|
+
generator.package_name.should == "org.devboy"
|
35
|
+
generator.class_name.should == "MyShinyClassTest"
|
36
|
+
generator.template_file.should == "as3/test/asunit3/klass.as.tt"
|
37
|
+
|
38
|
+
end
|
39
|
+
gator.run_with_default_mock
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
3
|
+
|
4
|
+
describe Gator::AS3::ASUnit3::RunnerGenerator do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should create a file in the correct location" do
|
15
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
16
|
+
gator.should_receive(:fork) do |&block|
|
17
|
+
block.call
|
18
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
19
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
20
|
+
Gator::AS3::ASUnit3::RunnerGenerator.start("org.devboy.MyShinyClass".split(" "))
|
21
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :test, :as3), "ASUnit3Runner.as")).should == true
|
22
|
+
end
|
23
|
+
gator.run_with_default_mock
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have the correct values" do
|
27
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
28
|
+
gator.should_receive(:fork) do |&block|
|
29
|
+
block.call
|
30
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
31
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
32
|
+
generator = Gator::AS3::ASUnit3::RunnerGenerator.new("org.devboy.MyShinyClass".split(" "))
|
33
|
+
generator.invoke_all
|
34
|
+
generator.package_name.should == ""
|
35
|
+
generator.class_name.should == "ASUnit3Runner"
|
36
|
+
generator.template_file.should == "as3/test/asunit3/runner.as.tt"
|
37
|
+
|
38
|
+
end
|
39
|
+
gator.run_with_default_mock
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
3
|
+
|
4
|
+
describe Gator::AS3::ASUnit3::SuiteGenerator do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should create a file in the correct location" do
|
15
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
16
|
+
gator.should_receive(:fork) do |&block|
|
17
|
+
block.call
|
18
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
19
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
20
|
+
Gator::AS3::ASUnit3::SuiteGenerator.start("org.devboy.MyShinyClass".split(" "))
|
21
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :test, :as3), "AllTests.as")).should == true
|
22
|
+
end
|
23
|
+
gator.run_with_default_mock
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have the correct values" do
|
27
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
28
|
+
gator.should_receive(:fork) do |&block|
|
29
|
+
block.call
|
30
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
31
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit3"
|
32
|
+
generator = Gator::AS3::ASUnit3::SuiteGenerator.new("org.devboy.MyShinyClass".split(" "))
|
33
|
+
generator.invoke_all
|
34
|
+
generator.package_name.should == ""
|
35
|
+
generator.class_name.should == "AllTests"
|
36
|
+
generator.template_file.should == "as3/test/asunit3/suite.as.tt"
|
37
|
+
|
38
|
+
end
|
39
|
+
gator.run_with_default_mock
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
3
|
+
|
4
|
+
describe Gator::AS3::ASUnit4::ClassTestGenerator do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should create a file in the correct location" do
|
15
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
16
|
+
gator.should_receive(:fork) do |&block|
|
17
|
+
block.call
|
18
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
19
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
20
|
+
Gator::AS3::ASUnit4::ClassTestGenerator.start("org.devboy.MyShinyClass".split(" "))
|
21
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :test, :as3), "org/devboy/MyShinyClassTest.as")).should == true
|
22
|
+
end
|
23
|
+
gator.run_with_default_mock
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have the correct values" do
|
27
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
28
|
+
gator.should_receive(:fork) do |&block|
|
29
|
+
block.call
|
30
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
31
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
32
|
+
generator = Gator::AS3::ASUnit4::ClassTestGenerator.new("org.devboy.MyShinyClass".split(" "))
|
33
|
+
generator.invoke_all
|
34
|
+
generator.package_name.should == "org.devboy"
|
35
|
+
generator.class_name.should == "MyShinyClassTest"
|
36
|
+
generator.template_file.should == "as3/test/asunit4/klass.as.tt"
|
37
|
+
|
38
|
+
end
|
39
|
+
gator.run_with_default_mock
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
3
|
+
|
4
|
+
describe Gator::AS3::ASUnit4::RunnerGenerator do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should create a file in the correct location" do
|
15
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
16
|
+
gator.should_receive(:fork) do |&block|
|
17
|
+
block.call
|
18
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
19
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
20
|
+
Gator::AS3::ASUnit4::RunnerGenerator.start("org.devboy.MyShinyClass".split(" "))
|
21
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :test, :as3), "ASUnit4Runner.as")).should == true
|
22
|
+
end
|
23
|
+
gator.run_with_default_mock
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have the correct values" do
|
27
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
28
|
+
gator.should_receive(:fork) do |&block|
|
29
|
+
block.call
|
30
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
31
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
32
|
+
generator = Gator::AS3::ASUnit4::RunnerGenerator.new("org.devboy.MyShinyClass".split(" "))
|
33
|
+
generator.invoke_all
|
34
|
+
generator.package_name.should == ""
|
35
|
+
generator.class_name.should == "ASUnit4Runner"
|
36
|
+
generator.template_file.should == "as3/test/asunit4/runner.as.tt"
|
37
|
+
|
38
|
+
end
|
39
|
+
gator.run_with_default_mock
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
3
|
+
|
4
|
+
describe Gator::AS3::ASUnit4::SuiteGenerator do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:each) do
|
11
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should create a file in the correct location" do
|
15
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
16
|
+
gator.should_receive(:fork) do |&block|
|
17
|
+
block.call
|
18
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
19
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
20
|
+
Gator::AS3::ASUnit4::SuiteGenerator.start("org.devboy.MyShinyClass".split(" "))
|
21
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :test, :as3), "AllTests.as")).should == true
|
22
|
+
end
|
23
|
+
gator.run_with_default_mock
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have the correct values" do
|
27
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
28
|
+
gator.should_receive(:fork) do |&block|
|
29
|
+
block.call
|
30
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators"
|
31
|
+
require File.dirname(__FILE__) + "/../../../../../lib/gator/as3/generators/test/asunit4"
|
32
|
+
generator = Gator::AS3::ASUnit4::SuiteGenerator.new("org.devboy.MyShinyClass".split(" "))
|
33
|
+
generator.invoke_all
|
34
|
+
generator.package_name.should == ""
|
35
|
+
generator.class_name.should == "AllTests"
|
36
|
+
generator.template_file.should == "as3/test/asunit4/suite.as.tt"
|
37
|
+
|
38
|
+
end
|
39
|
+
gator.run_with_default_mock
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Gator::MXML::ApplicationGenerator do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:each) do
|
10
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should create a file in the correct location" do
|
14
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
15
|
+
gator.should_receive(:fork) do |&block|
|
16
|
+
block.call
|
17
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
18
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/mxml/generators"
|
19
|
+
Gator::MXML::ApplicationGenerator.start("org.devboy.MyShinyClass".split(" "))
|
20
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :main, :as3), "org/devboy/MyShinyClass.mxml")).should == true
|
21
|
+
end
|
22
|
+
gator.run_with_default_mock
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should have the correct values" do
|
26
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
27
|
+
gator.should_receive(:fork) do |&block|
|
28
|
+
block.call
|
29
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
30
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/mxml/generators"
|
31
|
+
generator = Gator::MXML::ApplicationGenerator.new("org.devboy.MyShinyClass".split(" "))
|
32
|
+
generator.invoke_all
|
33
|
+
generator.package_name.should == "org.devboy"
|
34
|
+
generator.class_name.should == "MyShinyClass"
|
35
|
+
generator.template_file.should == "mxml/application.mxml.tt"
|
36
|
+
|
37
|
+
end
|
38
|
+
gator.run_with_default_mock
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Gator::MXML::ComponentGenerator do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:each) do
|
10
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should create a file in the correct location" do
|
14
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
15
|
+
gator.should_receive(:fork) do |&block|
|
16
|
+
block.call
|
17
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
18
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/mxml/generators"
|
19
|
+
Gator::MXML::ComponentGenerator.start("org.devboy.MyShinyClass".split(" "))
|
20
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :main, :as3), "org/devboy/MyShinyClass.mxml")).should == true
|
21
|
+
end
|
22
|
+
gator.run_with_default_mock
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should have the correct values" do
|
26
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
27
|
+
gator.should_receive(:fork) do |&block|
|
28
|
+
block.call
|
29
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
30
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/mxml/generators"
|
31
|
+
generator = Gator::MXML::ComponentGenerator.new("org.devboy.MyShinyClass".split(" "))
|
32
|
+
generator.invoke_all
|
33
|
+
generator.package_name.should == "org.devboy"
|
34
|
+
generator.class_name.should == "MyShinyClass"
|
35
|
+
generator.template_file.should == "mxml/component.mxml.tt"
|
36
|
+
|
37
|
+
end
|
38
|
+
gator.run_with_default_mock
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Gator::MXML::SkinGenerator do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
FileUtils.mkdir_p SANDBOX_LOCATION
|
7
|
+
end
|
8
|
+
|
9
|
+
after(:each) do
|
10
|
+
FileUtils.rm_r(SANDBOX_LOCATION) if File.directory? SANDBOX_LOCATION
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should create a file in the correct location" do
|
14
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
15
|
+
gator.should_receive(:fork) do |&block|
|
16
|
+
block.call
|
17
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
18
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/mxml/generators"
|
19
|
+
Gator::MXML::SkinGenerator.start("org.devboy.MyShinyClass".split(" "))
|
20
|
+
File.exist?(File.join(Gator::Project.project.path(:source, :main, :as3), "org/devboy/MyShinyClassSkin.mxml")).should == true
|
21
|
+
end
|
22
|
+
gator.run_with_default_mock
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should have the correct values" do
|
26
|
+
gator = GatorProcess.new SANDBOX_LOCATION
|
27
|
+
gator.should_receive(:fork) do |&block|
|
28
|
+
block.call
|
29
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/as3/generators"
|
30
|
+
require File.dirname(__FILE__) + "/../../../lib/gator/mxml/generators"
|
31
|
+
generator = Gator::MXML::SkinGenerator.new("org.devboy.MyShinyClass".split(" "))
|
32
|
+
generator.invoke_all
|
33
|
+
generator.package_name.should == "org.devboy"
|
34
|
+
generator.class_name.should == "MyShinyClassSkin"
|
35
|
+
generator.template_file.should == "mxml/skin.mxml.tt"
|
36
|
+
|
37
|
+
end
|
38
|
+
gator.run_with_default_mock
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
end
|