test/unit/adt_test.rb in flashsdk-1.0.29.pre vs test/unit/adt_test.rb in flashsdk-1.0.33.pre
- old
+ new
@@ -4,25 +4,24 @@
include Sprout::TestHelper
context "An ADT tool" do
setup do
- @fixture = File.join 'test', 'fixtures', 'air', 'simple'
- @application_xml = File.join @fixture, 'SomeProject.xml'
- @expected_output = File.join @fixture, 'SomeProject.air'
- @apk_input = File.join @fixture, 'SomeProject.apk'
- @ipa_output = File.join @fixture, 'SomeProject.ipa'
- @swf_input = File.join @fixture, 'SomeProject.swf'
- @swf_main = File.join @fixture, 'SomeProject.mxml'
-
- @certificate = File.join @fixture, 'SomeProject.pfx'
- @ipa_cert = File.join @fixture, 'SomeProject.p12'
- @provisioning_profile = File.join @fixture, 'Profile.mobileprovision'
- @platform = 'android'
- @target = 'apk-debug'
- @appid = 'com.foo.bar.SomeProject'
- @cert_password = 'samplePassword'
+ @fixture = File.join 'test', 'fixtures', 'air', 'simple'
+ @application_xml = File.join @fixture, 'SomeProject.xml'
+ @expected_output = File.join @fixture, 'SomeProject.air'
+ @apk_input = File.join @fixture, 'SomeProject.apk'
+ @ipa_output = File.join @fixture, 'SomeProject.ipa'
+ @swf_input = File.join @fixture, 'SomeProject.swf'
+ @swf_main = File.join @fixture, 'SomeProject.mxml'
+ @certificate = File.join @fixture, 'SomeProject.pfx'
+ @ipa_cert = File.join @fixture, 'SomeProject.p12'
+ @provisioning_profile = File.join @fixture, 'Profile.mobileprovision'
+ @platform = 'android'
+ @target = 'apk-debug'
+ @appid = 'com.foo.bar.SomeProject'
+ @cert_password = 'samplePassword'
end
teardown do
clear_tasks
remove_file @expected_output
@@ -44,65 +43,85 @@
#t.execute
#assert_file @expected_output
end
end
+
+ should "package a SWF and complex assets with an application.xml" do
+ as_a_unix_system do
+ t = adt @expected_output do |t|
+ t.package = true
+ t.target = @target
+ t.package_input = @application_xml
+ t.package_output = @expected_output
+ t.storetype = 'PKCS12'
+ t.keystore = @certificate
+ t.storepass = @cert_password
+ t.included_files << @swf_input
+ t.file_options << 'bin path/to/asset.xml'
+ end
+ assert_equal "-package -target #{@target} -storetype PKCS12 -keystore test/fixtures/air/simple/SomeProject.pfx -storepass samplePassword test/fixtures/air/simple/SomeProject.air test/fixtures/air/simple/SomeProject.xml test/fixtures/air/simple/SomeProject.swf -C bin path/to/asset.xml", t.to_shell
- should "package an iOS swf with a provisioning profile" do
+ #t.execute
+ #assert_file @expected_output
+ end
+ end
+
+ should "package an iOS swf with a provisioning profile" do
as_a_unix_system do
t = adt @ipa_output do |t|
t.package = true
t.target = 'ipa-test'
t.package_input = @application_xml
t.package_output = @ipa_output
t.storetype = 'PKCS12'
t.keystore = @ipa_cert
t.storepass = @cert_password
- t.provisioning_profile = @provisioning_profile
+ t.provisioning_profile = @provisioning_profile
t.included_files << @swf_input
end
assert_equal "-package -target ipa-test -storetype PKCS12 -keystore #{@ipa_cert} -storepass #{@cert_password} -provisioning-profile #{@provisioning_profile} #{@ipa_output} #{@application_xml} #{@swf_input}", t.to_shell
#t.execute
#assert_file @expected_output
end
end
- should "install an APK" do
+ should "install an APK" do
as_a_unix_system do
t = adt @expected_output do |t|
- t.installApp = true
- t.platform = @platform
- t.package = true
- t.package_input = @apk_input
+ t.installApp = true
+ t.platform = @platform
+ t.package = true
+ t.package_input = @apk_input
end
assert_equal "-installApp -platform #{@platform} -package #{@apk_input}", t.to_shell
#t.execute
#assert_file @expected_output
end
end
- should "uninstall an APK" do
+ should "uninstall an APK" do
as_a_unix_system do
t = adt @expected_output do |t|
- t.uninstallApp = true
- t.platform = @platform
- t.appid = @appid
+ t.uninstallApp = true
+ t.platform = @platform
+ t.appid = @appid
end
assert_equal "-uninstallApp -platform #{@platform} -appid #{@appid}", t.to_shell
#t.execute
#assert_file @expected_output
end
end
- should "launch an app" do
+ should "launch an app" do
as_a_unix_system do
t = adt @expected_output do |t|
- t.launchApp = true
- t.platform = @platform
- t.appid = @appid
+ t.launchApp = true
+ t.platform = @platform
+ t.appid = @appid
end
assert_equal "-launchApp -platform #{@platform} -appid #{@appid}", t.to_shell
#t.execute
#assert_file @expected_output