module Marso::StoryLoad

Public Instance Methods

load(mode=:scenario_contexts) click to toggle source
# File lib/marso/domain/story/story_load.rb, line 6
def load(mode=:scenario_contexts)
  new_ctx = self.ctx.clone
  new_ctx[:story_id] = self.id
  file_path_pattern = File.join(self.rootpath, 'scenarios/*.rb')

  scenario_ctxs = Marso.load_components(:scenario_context, file_path_pattern, new_ctx)

  new_description = self.description.clone
  new_description[:scenario_contexts] = scenario_ctxs
  return Story.new(new_description, new_ctx)
end