Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
markburns opened this issue Jan 4, 2024 · 0 comments
Open

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

markburns opened this issue Jan 4, 2024 · 0 comments
Labels

Comments

@markburns
Copy link
Owner

markburns commented Jan 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant