Sha256: b9431b0fc48f0add358826f2750613f0848de5a66d3869ce64d9f3b0fec6f7fd

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

# = Filename Utilities Test Case
#
#--
# Ruby version 1.8
#
# == Authors
# * Yomei Komiya
# 
# == Copyright
# 2008 the original author or authors.
#
# == License
# Apache License 2.0
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#  http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#++
# == Version
# SVN: $Id: filename_utils_test.rb 76 2008-10-12 11:45:33Z whitestar $
#
# == Since
# File available since Release 0.8.0

require 'commons/ruby/test/unit'

require 'commons/io/filename_utils'

module Commons
  module IO
    
    class FilenameUtilsTest  < Test::Unit::TestCase
      
      def setup
      end
      
      
      def teardown
      end
      
      
      def test_initialize
        # no test.
      end
      
      
      def test_absolute?
        assert_true(FilenameUtils.absolute?('/'))
        assert_true(FilenameUtils.absolute?('/var/lib'))
        assert_false(FilenameUtils.absolute?('./bin'))
        assert_false(FilenameUtils.absolute?('../bin'))
        assert_false(FilenameUtils.absolute?('work'))

        assert_true(FilenameUtils.absolute?('c:/'))
        assert_true(FilenameUtils.absolute?('d:/var/lib'))
        assert_true(FilenameUtils.absolute?('D:\\var\\lib'))
      end
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rcommons-0.8.0 test/commons/io/filename_utils_test.rb