Skip pygments tests if pygmentize isn't available

This commit is contained in:
Joshua Peek
2011-06-13 22:06:08 -05:00
parent f7233b8daf
commit 132067a201
4 changed files with 45 additions and 29 deletions

View File

@@ -8,6 +8,16 @@ module Linguist
@name_index = {}
@alias_index = {}
# Internal: Test if system has Pygments
#
# Only used in tests to disable tests that require Pygments.
#
# Returns true if `pygmentize` in is PATH otherwise false.
def self.has_pygments?
`which #{Albino.bin}`
$?.success?
end
# Public: Get all Lexers
#
# Returns an Array of Lexers