Skip to content

Commit

Permalink
add note about expect_inputs and promise_outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
markburns authored Dec 26, 2023
1 parent d6c0159 commit 09233f2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ This allows you to quickly see exactly where you missed assigning something to t
Combine with lambda debugging `->(ctx) { byebug if ctx.order_id.nil?},` in your chains to drop into the exact
location in the chain to find where to make the change.

### RSpec matchers
Easily add [low value, low cost](https://noelrappin.com/blog/2017/02/high-cost-tests-and-high-value-tests/) specs for your expects and promises.

```ruby
expect(described_class).to expect_inputs(:order_id)
expect(described_class).to promise_outputs(:order)
```

### Sidekiq Jobs
Sometimes you want to asyncify an interactor.

Expand Down Expand Up @@ -347,15 +355,9 @@ This will be validated at test time against the interactors promises.

## Installation

TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.

Install the gem and add to the application's Gemfile by executing:

$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
```Gemfile
gem 'interactify'
```

## Usage

Expand Down

0 comments on commit 09233f2

Please sign in to comment.