Skip to content

Commit

Permalink
Use fail instead of raise to signal exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Dec 8, 2013
1 parent 0fba0c4 commit 5b97b83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/yardstick/config.rb
Expand Up @@ -116,7 +116,7 @@ def for_rule(rule_class)
if key
RuleConfig.new(@rules.fetch(key.to_sym, {}))
else
raise InvalidRule, "every rule must begin with #{NAMESPACE_PREFIX}"
fail InvalidRule, "every rule must begin with #{NAMESPACE_PREFIX}"
end
end

Expand Down
6 changes: 3 additions & 3 deletions lib/yardstick/rake/verify.rb
Expand Up @@ -91,7 +91,7 @@ def define
# @api private
def assert_threshold
unless @threshold
raise 'threshold must be set'
fail 'threshold must be set'
end
end

Expand All @@ -105,7 +105,7 @@ def assert_threshold
# @api private
def assert_meets_threshold
if lower_coverage?
raise "YARD-Coverage must be at least #{@threshold}% but was #{total_coverage}%"
fail "YARD-Coverage must be at least #{@threshold}% but was #{total_coverage}%"
end
end

Expand All @@ -119,7 +119,7 @@ def assert_meets_threshold
# @api private
def assert_matches_threshold
if @config.require_exact_threshold? && higher_coverage?
raise "YARD-Coverage has increased above the threshold of #{@threshold}% to #{total_coverage}%. You should update your threshold value."
fail "YARD-Coverage has increased above the threshold of #{@threshold}% to #{total_coverage}%. You should update your threshold value."
end
end

Expand Down

0 comments on commit 5b97b83

Please sign in to comment.