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
path: root/qa
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-11-17 15:27:16 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-11-17 20:01:53 +0300
commit9ac0c76b78cd04b2505924f003dd720a0f155959 (patch)
tree67af1f0be0b9d6b5fc42b27c5afe5516e2c7574c /qa
parent0af35d7e30e373b885bfddb30b14718d72d75ab0 (diff)
Use StrongMemoize and enable/disable cops properly
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/runtime/scenario.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/qa/qa/runtime/scenario.rb b/qa/qa/runtime/scenario.rb
index 7ef59046640..15d4112d347 100644
--- a/qa/qa/runtime/scenario.rb
+++ b/qa/qa/runtime/scenario.rb
@@ -6,13 +6,15 @@ module QA
module Scenario
extend self
- attr_reader :attributes
+ def attributes
+ @attributes ||= {}
+ end
def define(attribute, value)
- (@attributes ||= {}).store(attribute.to_sym, value)
+ attributes.store(attribute.to_sym, value)
define_singleton_method(attribute) do
- @attributes[attribute.to_sym].tap do |value|
+ attributes[attribute.to_sym].tap do |value|
if value.to_s.empty?
raise ArgumentError, "Empty `#{attribute}` attribute!"
end