Class: SpecForge::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/spec_forge/step.rb,
lib/spec_forge/step/call.rb,
lib/spec_forge/step/expect.rb,
lib/spec_forge/step/source.rb

Overview

Represents a single executable step within a blueprint

Steps are the fundamental unit of execution in SpecForge. Each step can contain a request, expectations, store operations, callbacks, and debug triggers. Steps are immutable value objects created from normalized YAML data.

Defined Under Namespace

Classes: Call, Expect, Source

Instance Method Summary collapse

Constructor Details

#initialize(**step) ⇒ Step

Creates a new Step from normalized YAML data

Transforms raw step data into structured objects for execution. Converts requests, expectations, hooks, and other attributes into their runtime representations.

Parameters:

  • step (Hash)

    Normalized step data from YAML



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/spec_forge/step.rb', line 42

def initialize(**step)
  step[:calls] = transform_calls(step[:calls])
  step[:debug] = step[:debug] == true
  step[:documentation] ||= nil
  step[:expects] = transform_expect(step[:expects])
  step[:hooks] = transform_hooks(step[:hooks])
  step[:included_by] = transform_source(step[:included_by])
  step[:request] = transform_request(step[:request])
  step[:source] = transform_source(step[:source])
  step[:store] = transform_store(step[:store])
  step[:tags] ||= nil

  super(step)
end

Instance Method Details

#callsBoolean

Returns:

  • (Boolean)

    Whether this step uses callbacks

  • (Boolean)

    Whether debug mode is enabled for this step

  • (Boolean)

    Whether this step registers callback hooks

  • (Boolean)

    Whether this step has expectations

  • (Boolean)

    Whether this step has a request action

  • (Boolean)

    Whether this step has store operations



31
# File 'lib/spec_forge/step.rb', line 31

attr_predicate :calls, :debug, :expects, :hooks, :request, :store