Sha256: 4b111402debc55311a96dc9bb365d756a6cbb334910b3b3bd6c568fe6e70c33f

Contents?: true

Size: 568 Bytes

Versions: 12

Compression:

Stored size: 568 Bytes

Contents

# Test for facets/file/topath.rb

require 'facets/file/split_all.rb'

require 'test/unit'


class TC_File_Split_All < Test::Unit::TestCase

  # mock file

  class MockFile < File
    def self.open( fname, mode, &blk )
      blk.call(self)
    end
    def self.read( fname=nil )
      @mock_content.clone
    end
    def self.write( str )
      @mock_content = str
    end
    def self.<<( str )
      (@mock_content ||="") << str
    end
  end

  def test_split_all
    fp = "this/is/test"
    assert_equal( ['this', 'is', 'test'], MockFile.split_all(fp) )
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/file/test_split_all.rb
facets-2.8.3 test/core/file/test_split_all.rb
facets-2.8.2 test/core/file/test_split_all.rb
facets-2.8.1 test/core/file/test_split_all.rb
facets-2.8.0 test/core/file/test_split_all.rb
facets-2.7.0 test/core/file/test_split_all.rb
facets-2.6.0 test/core/file/test_split_all.rb
facets-2.3.0 test/core/file/test_split_all.rb
facets-2.2.1 test/unit/file/test_split_all.rb
facets-2.5.1 test/core/file/test_split_all.rb
facets-2.5.0 test/core/file/test_split_all.rb
facets-2.5.2 test/core/file/test_split_all.rb