Sha256: d9568337e8d7603e1d86b10f3c2a6ec51078dd4a7f7fb81a7c1736f000bb09b2

Contents?: true

Size: 1020 Bytes

Versions: 10

Compression:

Stored size: 1020 Bytes

Contents

#!/usr/local/bin/ruby
if $0 == __FILE__
  Dir.chdir File.dirname(__FILE__)+'/../'
  $:.unshift File.expand_path('../lib/')
end

require 'rio'
require 'tc/testcase'

class TC_route < Test::RIO::TestCase
  @@once = false
  def self.once
    @@once = true
  end
  def setup
    super
    self.class.once unless @@once
  end
  def test_rf_file
    a = rio("file://ahost/a/")
    extra = rio('b')/'c'
    c = a/extra
    rf = c.route_from(a)
    assert_equal(extra,rf)
    assert_equal(c,rf.abs)
  end
  def test_rf_drive
    a = rio("q:/a/")
    extra = rio('b')/'c'
    c = a/extra
    rf = c.route_from(a)
    assert_equal(extra,rf)
    assert_equal(c,rf.abs)
  end
  def test_rt_file
    a = rio("file://ahost/a/")
    extra = rio('b')/'c'
    c = a/extra
    r = a.route_to(c)
    assert_equal(extra,r)
    assert_equal(c,r.abs)
  end
  def test_rf_http
    a = rio("http://ahost/a/")
    extra = rio('b')/'c'
    c = rio(a,extra)
    rf = c.route_from(a)
    assert_equal(extra,rf)
    assert_equal(c,rf.abs)
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rio-0.6.0 test/tc/route.rb
wishdev-rio-0.4.3.1 test/tc/route.rb
rio-0.5.1 test/tc/route.rb
rio-0.3.8 test/tc/route.rb
rio-0.3.9 test/tc/route.rb
rio-0.3.7 test/tc/route.rb
rio-0.3.6 test/tc/route.rb
rio-0.4.1 test/tc/route.rb
rio-0.4.2 test/tc/route.rb
rio-0.4.0 test/tc/route.rb