Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-25 19:26:55 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-25 19:26:55 +0300
commit04108611716c0f1bb00092077ad5e31785675490 (patch)
tree3fed8b7f66b790887ddaee21197fd9fe946c739a /lib/gitlab/ci/config
parent4509594e206f93cdb54d80ae96fe7ad3d6a8fa4b (diff)
Add specs for attributable aspect of ci config entry
Diffstat (limited to 'lib/gitlab/ci/config')
-rw-r--r--lib/gitlab/ci/config/entry/attributable.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/ci/config/entry/attributable.rb b/lib/gitlab/ci/config/entry/attributable.rb
index 24ff862a142..3e87a09704e 100644
--- a/lib/gitlab/ci/config/entry/attributable.rb
+++ b/lib/gitlab/ci/config/entry/attributable.rb
@@ -8,7 +8,9 @@ module Gitlab
class_methods do
def attributes(*attributes)
attributes.flatten.each do |attribute|
- raise ArgumentError if method_defined?(attribute)
+ if method_defined?(attribute)
+ raise ArgumentError, 'Method already defined!'
+ end
define_method(attribute) do
return unless config.is_a?(Hash)