Sha256: 63b893e7eab9a871663294d4820e851c2fdff6bc345f0f66247727a296e7488c
Contents?: true
Size: 1.22 KB
Versions: 38
Compression:
Stored size: 1.22 KB
Contents
# -*- coding: utf-8 -*- # # @file # @brief # @author ongaeshi # @date 2010/10/21 require 'test_helper' require 'milkode/cdweb/lib/mkurl' module Milkode class TestMkurl < Test::Unit::TestCase def test_basic p1 = {:query => 'test', :shead => 'package', :page => '2'} p2 = {:query => 'test', :page => '2'} p3 = {:page => '2'} assert_equal '/home/foo/bar.hpp?query=test&shead=package', Mkurl.new('/home/foo/bar.hpp', p1).inherit_query_shead assert_equal '.?query=test&shead=package', Mkurl.new('.', p1).inherit_query_shead assert_equal '/home/foo/bar.hpp?query=test', Mkurl.new('/home/foo/bar.hpp', p2).inherit_query_shead assert_equal '/home/foo/bar.hpp', Mkurl.new('/home/foo/bar.hpp', p3).inherit_query_shead assert_equal '/home/foo/bar.hpp?shead=package', Mkurl.new('/home/foo/bar.hpp', p1).inherit_shead assert_equal '.?shead=package', Mkurl.new('.', p1).inherit_shead assert_equal '/home/foo/bar.hpp', Mkurl.new('/home/foo/bar.hpp', p2).inherit_shead assert_equal '/home/foo/bar.hpp', Mkurl.new('/home/foo/bar.hpp', p3).inherit_shead assert_equal '/home?sort=addtime', Mkurl.new('/home', p3).inherit_query_shead_set_sort('addtime') end end end
Version data entries
38 entries across 38 versions & 1 rubygems