/
dependencies.rb
39 lines (33 loc) · 1.19 KB
/
dependencies.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module Gitnesse
class Dependencies
class NoGitError < StandardError ; end
class NoCucumberError < StandardError ; end
class NoRepositoryURLError < StandardError ; end
class NoAnnotationInfoError < StandardError ; end
# Checks Gitnesse's dependencies, and throws an error if one of them is
# missing.
def self.check
check_git
check_cucumber
check_repository_url
check_annotation_info
end
protected
def self.check_git
raise NoGitError, "git not found or not working." unless Kernel.system("git --version &> /dev/null")
end
def self.check_cucumber
raise NoCucumberError, "cucumber not found or not working." unless Kernel.system("cucumber --version &> /dev/null")
end
def self.check_repository_url
raise NoRepositoryURLError, "You must select a repository_url to run Gitnesse." if Gitnesse.configuration.repository_url.nil?
end
def self.check_annotation_info
if Gitnesse.configuration.annotate_results
if Gitnesse.configuration.info.nil?
raise NoAnnotationInfoError, "You must enter local information to annotate test results in the wiki"
end
end
end
end
end