Module: Gitlab::Experiment::RSpecMatchers
- Extended by:
- RSpec::Matchers::DSL
- Defined in:
- lib/gitlab/experiment/rspec.rb
Instance Method Summary collapse
- #require_experiment(experiment, matcher, instances_only: true) ⇒ Object
- #tracked_experiments ⇒ Object
Instance Method Details
#require_experiment(experiment, matcher, instances_only: true) ⇒ Object
162 163 164 165 166 167 168 169 170 171 |
# File 'lib/gitlab/experiment/rspec.rb', line 162 def require_experiment(experiment, matcher, instances_only: true) klass = experiment.instance_of?(Class) ? experiment : experiment.class raise ArgumentError, "the #{matcher} matcher is limited to experiments" unless klass <= Gitlab::Experiment if instances_only && experiment == klass raise ArgumentError, "the #{matcher} matcher is limited to experiment instances" end experiment end |
#tracked_experiments ⇒ Object
173 174 175 |
# File 'lib/gitlab/experiment/rspec.rb', line 173 def tracked_experiments @_tracked_experiments end |