Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added dependency check for config.info

  • Loading branch information...
commit 0b4dbe351ce83f51586015196093fad4428d15aa 1 parent c27e970
@stewart stewart authored
View
9 lib/gitnesse/dependencies.rb
@@ -3,6 +3,7 @@ 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.
@@ -25,5 +26,13 @@ def self.check_cucumber
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
View
15 test/lib/gitnesse/dependencies_check_test.rb
@@ -42,4 +42,19 @@
it { method.call.must_be_nil }
end
end
+
+ describe "#check_annotation_info" do
+ let(:method) { lambda { Gitnesse::Dependencies.check_annotation_info } }
+ before { Gitnesse.configuration.annotate_results = true }
+
+ describe "when info is defined" do
+ before { Gitnesse.configuration.info = "Bob Martin's workstation" }
+ it { method.call.must_be_nil }
+ end
+
+ describe "when info is not defined" do
+ before { Gitnesse.configuration.info = nil }
+ it { method.must_raise Gitnesse::Dependencies::NoAnnotationInfoError }
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.