diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-11-17 20:27:16 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-11-18 01:01:53 +0800 |
commit | 9ac0c76b78cd04b2505924f003dd720a0f155959 (patch) | |
tree | 67af1f0be0b9d6b5fc42b27c5afe5516e2c7574c /qa | |
parent | 0af35d7e30e373b885bfddb30b14718d72d75ab0 (diff) | |
download | gitlab-ce-9ac0c76b78cd04b2505924f003dd720a0f155959.tar.gz |
Use StrongMemoize and enable/disable cops properly
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/runtime/scenario.rb | 8 |
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 |