Class: SpecForge::Blueprint

Inherits:
Object
  • Object
show all
Defined in:
lib/spec_forge/blueprint.rb

Overview

Represents a loaded blueprint containing a sequence of test steps

A Blueprint is the runtime representation of a YAML blueprint file. It contains metadata about the file and an ordered list of Step objects ready for execution.

Examples:

blueprint = Blueprint.new(
  file_path: Pathname.new("spec_forge/blueprints/users.yml"),
  name: "users",
  steps: [{name: "Create user", request: {...}}]
)

Instance Method Summary collapse

Constructor Details

#initialize(file_path:, name:, steps: [], hooks: {}) ⇒ Blueprint

Returns a new instance of Blueprint.



19
20
21
22
23
24
25
# File 'lib/spec_forge/blueprint.rb', line 19

def initialize(file_path:, name:, steps: [], hooks: {})
  file_name = file_path.basename.to_s
  steps = steps.map { |s| Step.new(**s) }
  hooks = Step::Call.wrap_hooks(hooks)

  super(file_path:, file_name:, hooks:, name:, steps:,)
end