Skip to content

support defining expects and promises in a .chain call #29

@markburns

Description

@markburns
organize \
  DoFoo,
  DoBar = self.if(
    :success,
    then: DoBaz = chain('DoBaz', A, B, C),
    else: Qux
  )

Here we have to use chain when assigning to a testable constant DoBaz

but if A expects something, then the interactor wiring specs will fail. Meaning you have to fully extract a class.

class DoBaz
  include Interactify
  expect :a
  organize A, B, C
end
organize \
  DoFoo,
  DoBar = self.if(
    :success,
    then: DoBaz,
    else: Qux
  )

OR we can do

organize \
  DoFoo,
  DoBar = self.if(
    :success,
    then: DoBaz = chain('DoBaz', A, B, C).expect(:a),
    else: Qux
  )

but here the expect can come visually far away from the start of the chain.

May be nice to have to do

organize \
  DoFoo,
  DoBar = self.if(
    :success,
    then: DoBaz = chain('DoBaz', A, B, C, expect: :a),
    else: Qux
  )
organize \
  DoFoo,
  DoBar = self.if(
    :success,
    then: DoBaz = chain('DoBaz', expect: :a, A, B, C),
    else: Qux
  )

Also to investigate why wiring specs are not passing in previous contract info into if and chain calls

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions