class ActiveSupport::TestCase

Adds the process_scenario method to ActiveSupport::TestCase and includes the Datum module @note Supports most extending test types (functional, integration, etc) @example Making a Scenario

# test/datum/scenarios/simpsons_scenario.rb
# any code included in this file gets loaded when calling process_scenario
@homer = Person.create(first_name: "Homer", last_name: "Simpson")
@marge = Person.create(__clone(@homer, {first_name: "Marge"}))

@!method process_scenario(scenario_name)

Imports a scenario file into the execution context of the current test
@param [Symbol, String] scenario_name The name of a scenario file
@return [void]
@example Using process_scenario
  test "should verify basic scenario" do
    process_scenario :simpsons_scenario
    assert_not_nil @homer, "process_scenario did not define @homer"
    assert_not_nil @marge, "process_scenario did not define @marge"
  end

Public Instance Methods

process_scenario(scenario_name) click to toggle source
# File lib/support/test.rb, line 26
def process_scenario scenario_name
  __import(scenario_name)
end