Sha256: e67dd999430ee8c8ecb38ad9765047f2b11c9c2a3c54a4c9f7fedc81df61e8ea

Contents?: true

Size: 1.17 KB

Versions: 42

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

class FlashHelperTest < Test::Unit::TestCase
  include Sprout::TestHelper

  context "A FlashHelper" do
    
    [
      { :input => 'com.foo.Bar', :expected => 'com.foo.Bar' },
      { :input => 'com/foo/Bar.as', :expected => 'com.foo.Bar' },
      { :input => 'com.out.HTML', :expected => 'com.out.HTML' }
      #{ :input => 'bar', :expected => 'Bar' }
    ].each do |input|
      
      should "return fully qualified classname for #{input[:input]}" do
        instance = FakeGenerator.new
        instance.input = input[:input]
        assert_equal input[:expected], instance.fake_fully_qualified_class_name
      end
    end    
    
    should  "work if :src is not defined" do
      instance = FakeGenerator.new
      instance.input = 'com/foo/bar.as'
      assert_equal ["com","foo","bar"], instance.fake_input_in_parts
      assert_equal ["com","foo","mommy"], instance.fake_input_in_parts("com.foo.mommy.mxml")
    end
    
  end
end

class FakeGenerator < Sprout::Generator::Base
  include FlashSDK::FlashHelper

  def fake_fully_qualified_class_name
    fully_qualified_class_name
  end

  def fake_input_in_parts value=nil
    input_in_parts value
  end
end

Version data entries

42 entries across 42 versions & 3 rubygems

Version Path
flashsdk_sqe-0.0.7 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.6 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.4 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.3 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.2 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.1 test/unit/flash_helper_test.rb
flashsdk-1.1.36.pre test/unit/flash_helper_test.rb
flashsdk-1.0.34.pre test/unit/flash_helper_test.rb
flashsdk-1.0.33.pre test/unit/flash_helper_test.rb
flashsdk-1.0.29.pre test/unit/flash_helper_test.rb
flashsdk-1.0.28.pre test/unit/flash_helper_test.rb
flashsdk-1.0.27.pre test/unit/flash_helper_test.rb
flashsdk-1.0.26.pre test/unit/flash_helper_test.rb
flashsdk-1.0.25.pre test/unit/flash_helper_test.rb
flashsdk-1.0.23.pre test/unit/flash_helper_test.rb
flashsdk-1.0.22.pre test/unit/flash_helper_test.rb
flashsdk-1.0.21.pre test/unit/flash_helper_test.rb
flashsdk-1.0.20.pre test/unit/flash_helper_test.rb
flashsdk-1.0.18.pre test/unit/flash_helper_test.rb
flashsdk-1.0.17.pre test/unit/flash_helper_test.rb