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.
Files changed (69) hide show
  1. data/Gemfile +3 -2
  2. data/Rakefile +7 -4
  3. data/VERSION +1 -1
  4. data/gator-as3.gemspec +73 -28
  5. data/lib/gator/as3.rb +3 -0
  6. data/lib/gator/as3/as3_configuration.rb +38 -0
  7. data/lib/gator/as3/generators/{collection.rb → as3/collection.rb} +5 -1
  8. data/lib/gator/as3/generators/as3/event.rb +14 -0
  9. data/lib/gator/as3/generators/as3/generator.rb +95 -0
  10. data/lib/gator/as3/generators/as3/interface.rb +14 -0
  11. data/lib/gator/as3/generators/as3/klass.rb +15 -0
  12. data/lib/gator/as3/generators/as3/test/asunit3.rb +3 -0
  13. data/lib/gator/as3/generators/as3/test/asunit3/collection.rb +21 -0
  14. data/lib/gator/as3/generators/as3/test/asunit3/klass.rb +32 -0
  15. data/lib/gator/as3/generators/as3/test/asunit3/runner.rb +28 -0
  16. data/lib/gator/as3/generators/as3/test/asunit3/suite.rb +38 -0
  17. data/lib/gator/as3/generators/{test → as3/test}/asunit4.rb +0 -0
  18. data/lib/gator/as3/generators/{test → as3/test}/asunit4/collection.rb +5 -1
  19. data/lib/gator/as3/generators/as3/test/asunit4/klass.rb +31 -0
  20. data/lib/gator/as3/generators/as3/test/asunit4/runner.rb +29 -0
  21. data/lib/gator/as3/generators/as3/test/asunit4/suite.rb +39 -0
  22. data/lib/gator/as3/generators/{test → as3/test}/flexunit4.rb +0 -0
  23. data/lib/gator/as3/generators/{test → as3/test}/flexunit4/collection.rb +1 -1
  24. data/lib/gator/as3/generators/as3/test/flexunit4/klass.rb +34 -0
  25. data/lib/gator/as3/generators/mxml/application.rb +16 -0
  26. data/lib/gator/as3/generators/mxml/collection.rb +20 -0
  27. data/lib/gator/as3/generators/mxml/component.rb +16 -0
  28. data/lib/gator/as3/generators/mxml/generator.rb +20 -0
  29. data/lib/gator/as3/generators/mxml/skin.rb +21 -0
  30. data/lib/gator/as3/templates/as3/event.as.tt +12 -0
  31. data/lib/gator/as3/templates/as3/interface.as.tt +6 -0
  32. data/lib/gator/as3/{generators → templates/as3}/klass.as.tt +0 -0
  33. data/lib/gator/as3/templates/as3/test/asunit3/klass.as.tt +37 -0
  34. data/lib/gator/as3/templates/as3/test/asunit3/runner.as.tt +13 -0
  35. data/lib/gator/as3/templates/as3/test/asunit3/suite.as.tt +17 -0
  36. data/lib/gator/as3/{generators → templates/as3}/test/asunit4/klass.as.tt +0 -0
  37. data/lib/gator/as3/templates/as3/test/asunit4/runner.as.tt +17 -0
  38. data/lib/gator/as3/templates/as3/test/asunit4/suite.as.tt +14 -0
  39. data/lib/gator/as3/{generators → templates/as3}/test/flexunit4/klass.as.tt +0 -0
  40. data/lib/gator/as3/templates/mxml/application.mxml.tt +30 -0
  41. data/lib/gator/as3/templates/mxml/component.mxml.tt +13 -0
  42. data/lib/gator/as3/templates/mxml/skin.mxml.tt +53 -0
  43. data/lib/gator/mxml/generators.rb +5 -0
  44. data/lib/gator/utils/as3_util.rb +45 -0
  45. data/rake/jeweler.rb +17 -0
  46. data/rake/jeweler_prerelease_tasks.rb +50 -0
  47. data/rake/pre_release_gemspec.rb +80 -0
  48. data/rake/pre_release_to_git.rb +59 -0
  49. data/spec/as3/generators/collection_spec.rb +46 -0
  50. data/spec/as3/generators/event_spec.rb +40 -0
  51. data/spec/as3/generators/interface_spec.rb +40 -0
  52. data/spec/as3/generators/klass_spec.rb +40 -0
  53. data/spec/as3/generators/test/asunit3/klass_spec.rb +43 -0
  54. data/spec/as3/generators/test/asunit3/runner_spec.rb +43 -0
  55. data/spec/as3/generators/test/asunit3/suite_spec.rb +43 -0
  56. data/spec/as3/generators/test/asunit4/klass_spec.rb +43 -0
  57. data/spec/as3/generators/test/asunit4/runner_spec.rb +43 -0
  58. data/spec/as3/generators/test/asunit4/suite_spec.rb +43 -0
  59. data/spec/mxml/generators/application_spec.rb +42 -0
  60. data/spec/mxml/generators/component_spec.rb +42 -0
  61. data/spec/mxml/generators/skin_spec.rb +42 -0
  62. data/spec/spec_helper.rb +36 -3
  63. metadata +86 -35
  64. data/lib/gator/as3/generators.rb +0 -3
  65. data/lib/gator/as3/generators/klass.rb +0 -53
  66. data/lib/gator/as3/generators/test/asunit4/klass.rb +0 -61
  67. data/lib/gator/as3/generators/test/flexunit4/klass.rb +0 -57
  68. data/spec/generators/collection_spec.rb +0 -11
  69. 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