Sha256: 6ee37c572fc8b81929727c5e9cc9dd7e295847048050cffc223357a268a94c63

Contents?: true

Size: 1.12 KB

Versions: 24

Compression:

Stored size: 1.12 KB

Contents

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

module TaliaCore
  class IoTester
    include TaliaUtil::IoHelper
  end
  
  # Test the Generic Xml Import
  class IoHelperTest < Test::Unit::TestCase
    
    def setup
      setup_once(:io) { IoTester.new }
      setup_once(:self) { File.expand_path(__FILE__) }
      setup_once(:self_dir) { File.dirname(@self) }
    end
    
    def test_file_url
      assert_equal('/test/file', @io.file_url('file:///test/file'))
    end
    
    def test_file_url_not
      assert_equal('http://foobar.com', @io.file_url('http://foobar.com'))
    end
    
    def test_base_for_file
      assert_equal(@self_dir, @io.base_for(@self))
    end
    
    def test_base_for_dir
      assert_equal(@self_dir, @io.base_for(@self_dir))
    end
    
    def test_base_for_uri
      assert_equal(URI.parse('http://foobar.com/foodanga/'), @io.base_for('http://foobar.com/foodanga/'))
    end
    
    def test_base_for_uri_doc
      assert_equal(URI.parse('http://foobar.com/foodanga/'), @io.base_for('http://foobar.com/foodanga/doc.xml'))
    end
    
    # TODO: Actual reader tests missing
    
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
talia_core-0.7.0 test/talia_util/io_helper_test.rb
talia_core-0.5.4 test/talia_util/io_helper_test.rb
talia_core-0.5.3 test/talia_util/io_helper_test.rb
talia_core-0.5.2 test/talia_util/io_helper_test.rb
talia_core-0.5.1 test/talia_util/io_helper_test.rb
talia_core-0.5.0 test/talia_util/io_helper_test.rb
talia_core-0.4.22 test/talia_util/io_helper_test.rb
talia_core-0.4.20 test/talia_util/io_helper_test.rb
talia_core-0.4.19 test/talia_util/io_helper_test.rb
talia_core-0.4.18 test/talia_util/io_helper_test.rb
talia_core-0.4.17 test/talia_util/io_helper_test.rb
talia_core-0.4.16 test/talia_util/io_helper_test.rb
talia_core-0.4.15 test/talia_util/io_helper_test.rb
talia_core-0.4.14 test/talia_util/io_helper_test.rb
talia_core-0.4.13 test/talia_util/io_helper_test.rb
talia_core-0.4.12 test/talia_util/io_helper_test.rb
talia_core-0.4.11 test/talia_util/io_helper_test.rb
talia_core-0.4.10 test/talia_util/io_helper_test.rb
talia_core-0.4.9 test/talia_util/io_helper_test.rb
talia_core-0.4.8 test/talia_util/io_helper_test.rb