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
h4oflashsdk-1.0.13 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.12 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.11 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.10 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.9 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.8 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.7 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.6 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.5 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.4 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.3 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.2 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.1 test/unit/flash_helper_test.rb
h4oflashsdk-1.0.0 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.14 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.13 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.12 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.11 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.10 test/unit/flash_helper_test.rb
flashsdk_sqe-0.0.9 test/unit/flash_helper_test.rb