mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Add Pathname
This commit is contained in:
@@ -2,3 +2,4 @@ module Linguist
|
||||
end
|
||||
|
||||
require 'linguist/language'
|
||||
require 'linguist/pathname'
|
||||
|
||||
11
lib/linguist/pathname.rb
Normal file
11
lib/linguist/pathname.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module Linguist
|
||||
class Pathname
|
||||
def initialize(path)
|
||||
@path = path
|
||||
end
|
||||
|
||||
def to_s
|
||||
@path.dup
|
||||
end
|
||||
end
|
||||
end
|
||||
11
test/test_pathname.rb
Normal file
11
test/test_pathname.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'linguist/pathname'
|
||||
|
||||
require 'test/unit'
|
||||
|
||||
class TestPathname < Test::Unit::TestCase
|
||||
include Linguist
|
||||
|
||||
def test_to_s
|
||||
assert_equal "file.rb", Pathname.new("file.rb").to_s
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user