Sha256: 60feadf4dc8cdaa72499d9dca72d120e66128036839d2452d0a6c5f3530585e3
Contents?: true
Size: 741 Bytes
Versions: 43
Compression:
Stored size: 741 Bytes
Contents
# frozen_string_literal: true module Gitlab module QA module Runtime ## # Singleton approach to global test scenario arguments. # module Scenario extend self def attributes @attributes ||= {} end def define(attribute, value) attributes.store(attribute.to_sym, value) define_singleton_method(attribute) do attributes[attribute.to_sym].tap do |value| raise ArgumentError, "Empty `#{attribute}` attribute!" if value.to_s.empty? end end end def method_missing(name, *) raise ArgumentError, "Scenario attribute `#{name}` not defined!" end end end end end
Version data entries
43 entries across 43 versions & 1 rubygems