test/unit/fcsh_test.rb in flashsdk-1.0.14.pre vs test/unit/fcsh_test.rb in flashsdk-1.0.15.pre
- old
+ new
@@ -4,25 +4,45 @@
include Sprout::TestHelper
context "associate FCSH with an MXMLC task" do
setup do
- @fixture = File.join fixtures, 'mxmlc', 'simple'
- @input = File.join @fixture, 'SomeFile.as'
- @expected_output = File.join @fixture, 'SomeFile.swf'
+ @fixture = File.join fixtures, 'mxmlc'
+ @input = File.join @fixture, 'simple', 'SomeFile.as'
+ @broken_input = File.join @fixture, 'broken', 'SomeFile.as'
+ @expected_output = File.join @fixture, 'simple', 'SomeFile.swf'
+
+ # Uncomment following to see output:
+ #Sprout.stdout = $stdout
+ #Sprout.stderr = $stderr
end
teardown do
remove_file @expected_output
end
+ should "collect errors as needed" do
+ mxmlc = FlashSDK::MXMLC.new
+ mxmlc.input = @broken_input
+
+ fcsh = FlashSDK::FCSH.new
+ fcsh.execute false
+ fcsh.mxmlc mxmlc.to_shell
+ fcsh.quit
+ fcsh.wait
+
+ expected_error_message = '1 Error: Syntax error: expecting rightbrace before end of program'
+ assert_matches /#{expected_error_message}/, Sprout.stderr.read
+ end
+
should "spin up FCSH" do
mxmlc = FlashSDK::MXMLC.new
mxmlc.input = @input
fcsh = FlashSDK::FCSH.new
fcsh.execute false
fcsh.mxmlc mxmlc.to_shell
+
FileUtils.touch @input
fcsh.compile 1
fcsh.quit
fcsh.wait