aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2012-07-23 16:50:30 -0500
committerJoshua Peek <josh@joshpeek.com>2012-07-23 16:50:30 -0500
commit6ac9138aed39e17427305509bdc8f865fedcd412 (patch)
tree8b272a011eaf0ef47217182cef6b082ba0680fe3 /test
parentbacfd4e832127c8436dd4aadfb9f43175c65e2f8 (diff)
Remove pathname
Closes #207
Diffstat (limited to 'test')
-rw-r--r--test/test_blob.rb4
-rw-r--r--test/test_pathname.rb62
2 files changed, 0 insertions, 66 deletions
diff --git a/test/test_blob.rb b/test/test_blob.rb
index 2bdc1cb..ecb8782 100644
--- a/test/test_blob.rb
+++ b/test/test_blob.rb
@@ -29,10 +29,6 @@ class TestBlob < Test::Unit::TestCase
assert_equal "foo.rb", blob("foo.rb").name
end
- def test_pathname
- assert_equal Pathname.new("foo.rb"), blob("foo.rb").pathname
- end
-
def test_mime_type
assert_equal "application/octet-stream", blob("Binary/dog.o").mime_type
assert_equal "application/ogg", blob("Binary/foo.ogg").mime_type
diff --git a/test/test_pathname.rb b/test/test_pathname.rb
deleted file mode 100644
index 2d7f842..0000000
--- a/test/test_pathname.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'linguist/pathname'
-
-require 'test/unit'
-require 'pygments'
-
-class TestPathname < Test::Unit::TestCase
- include Linguist
-
- Lexer = Pygments::Lexer
-
- def test_to_s
- assert_equal "file.rb", Pathname.new("file.rb").to_s
- end
-
- def test_basename
- assert_equal 'file.rb', Pathname.new("file.rb").basename
- assert_equal 'file.rb', Pathname.new("./file.rb").basename
- assert_equal 'file.rb', Pathname.new("sub/dir/file.rb").basename
- assert_equal '.profile', Pathname.new(".profile").basename
- end
-
- def test_extname
- assert_equal '.rb', Pathname.new("file.rb").extname
- assert_equal '.rb', Pathname.new("./file.rb").extname
- assert_equal '.rb', Pathname.new("sub/dir/file.rb").extname
- assert_equal '', Pathname.new(".profile").extname
- end
-
- def test_language
- assert_nil Pathname.new(".rb").language
-
- assert_equal Language['Ruby'], Pathname.new("file.rb").language
- assert_equal Language['Ruby'], Pathname.new("./file.rb").language
- assert_equal Language['Ruby'], Pathname.new("sub/dir/file.rb").language
-
- assert_equal Language['Ruby'], Pathname.new("Rakefile").language
- assert_equal Language['Ruby'], Pathname.new("vendor/Rakefile").language
- assert_equal Language['Ruby'], Pathname.new("./Rakefile").language
-
- assert_equal Language['Gentoo Ebuild'], Pathname.new("file.ebuild").language
- assert_equal Language['Python'], Pathname.new("itty.py").language
- assert_equal Language['Nu'], Pathname.new("itty.nu").language
-
- assert_nil Pathname.new("defu.nkt").language
- end
-
- def test_lexer
- assert_equal Lexer['Ruby'], Pathname.new("file.rb").lexer
- assert_equal Lexer['Ruby'], Pathname.new("Rakefile").lexer
- assert_equal Lexer['Bash'], Pathname.new("file.ebuild").lexer
- assert_equal Lexer['Python'], Pathname.new("itty.py").lexer
- assert_equal Lexer['Scheme'], Pathname.new("itty.nu").lexer
- assert_equal Lexer['Text only'], Pathname.new("defu.nkt").lexer
- end
-
- def test_mime_type
- assert_equal 'application/x-ruby', Pathname.new("file.rb").mime_type
- assert_equal 'application/javascript', Pathname.new("file.js").mime_type
- assert_equal 'application/x-python', Pathname.new("itty.py").mime_type
- assert_equal 'text/plain', Pathname.new("defu.nkt").mime_type
- end
-end