Sha256: 75e14671c53e5fd9d3e489668517200068cd73ced004fd78e242d983d04f074a

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 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 = AS3::MXMLC.new
        mxmlc.input = @input
        mxmlc.source_path << @fixture
        assert_equal '--source-path+=test/fixtures/mxmlc/simple test/fixtures/mxmlc/simple/SomeFile.as', mxmlc.to_shell
      end
    end

    should "compile a swf" do
      mxmlc = AS3::MXMLC.new
      mxmlc.input = @input
      # Turn on to trigger an actual compilation:
      # (This is too damn slow to leave in the every-time test run)
      mxmlc.execute
      assert_file @expected_output
    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

2 entries across 2 versions & 1 rubygems

Version Path
as3-1.0.3.pre test/unit/mxmlc_test.rb
as3-1.0.1.pre test/unit/mxmlc_test.rb