Sha256: 5de12b5fd4bd498c04935eeaefb124915632aa9dc4758577e957d67b0d9c5c6f

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')

class MXMLCTest < Test::Unit::TestCase
  include SproutTestCase

  context "An MXMLC tool" do

    setup do
      @fixture         = File.join 'test', 'fixtures', 'mxmlc', 'simple'
      @input           = File.join @fixture, 'SomeFile.as'
      @expected_output = File.join @fixture, 'SomeFile.swf'
      #Sprout::Log.debug = false
    end

    teardown do
      remove_file @expected_output
    end

    should "accept input" do
      as_a_unix_system do
        mxmlc = FlashSDK::MXMLC.new
        mxmlc.input = @input
        mxmlc.source_path << @fixture
        assert_equal '--source-path+=test/fixtures/mxmlc/simple --static-link-runtime-shared-libraries test/fixtures/mxmlc/simple/SomeFile.as', mxmlc.to_shell
      end
    end

    should "compile a swf" do
      mxmlc = FlashSDK::MXMLC.new
      mxmlc.input = @input
      mxmlc.execute
      assert_file @expected_output
    end
    

    should "assign default-size" do
      mxmlc = FlashSDK::MXMLC.new
      mxmlc.default_size = '800,500'
      mxmlc.static_link_runtime_shared_libraries = false
      assert_equal '--default-size=800,500', mxmlc.to_shell
    end

    should "assign simple output" do
      t = mxmlc 'bin/SomeProject.swf' do |t|
        t.input = @input
      end
      assert_equal 'bin/SomeProject.swf', t.output
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flashsdk-1.0.5.pre test/unit/mxmlc_test.rb