Module: Synthra::Scenarios::MinitestHelpers::ClassMethods
- Defined in:
- lib/synthra/scenarios.rb
Instance Method Summary collapse
Instance Method Details
#use_scenario(scenario_name, **options) ⇒ Object
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'lib/synthra/scenarios.rb', line 389 def use_scenario(scenario_name, **) define_method(:setup_scenario) do scenario = Scenarios[scenario_name] @scenario_context = scenario.build(**) @scenario_context.data.each do |name, value| instance_variable_set("@#{name}", value) end end # Hook into setup prepend(Module.new do def setup setup_scenario super end end) end |