Sha256: 048cecff4f1cacccc79431229444bbee42fefbaf28a9473dd2975e8d7d012553

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

require 'test_helper'

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

  context "a file target" do
    setup do
      @asunit_swc = 'bin/AsUnit4-4.1.pre.swc'
    end

    context "that is created with a constructor block" do
      should "have the provided values" do
        target = Sprout::FileTarget.new do |t|
          t.pkg_name    = 'asunit4'
          t.pkg_version = '4.2.2.pre'
          t.add_library :swc, @asunit_swc
        end
        assert_provided_values target
      end
    end

    context "that is created with no constructor block" do
      should "have the provided values" do
        target = Sprout::FileTarget.new
        target.pkg_name    = 'asunit4'
        target.pkg_version = '4.2.2.pre'
        target.add_library :swc, @asunit_swc
        assert_provided_values target
      end
    end

  end

  private

  def assert_provided_values t
    assert_equal :universal, t.platform
    assert_equal 0, t.executables.size
    assert_equal 1, t.libraries.size
    library = t.libraries.first
    assert_equal :swc, library.name
    assert_equal File.join('.', @asunit_swc), library.path
    assert_equal '[FileTarget pkg_name=asunit4 pkg_version=4.2.2.pre platform=universal]', t.to_s
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sprout-1.0.35.pre test/unit/file_target_test.rb
sprout-1.0.32.pre test/unit/file_target_test.rb
sprout-1.0.31.pre test/unit/file_target_test.rb
sprout-1.0.29.pre test/unit/file_target_test.rb