Skip to content

Commit

Permalink
chore(ci): Fix CI violations
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscz committed Sep 16, 2021
1 parent cfbb734 commit b0f8228
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ end
# for asynchronous subscriptions (minitest)
def test_is_subscribed_to_some_event
event = MyEvent.new(some: "data")

assert_async_event_subscriber_enqueued(MySubscriberService, event: event) do
ActiveEventStore.publish event
end
end
```

**NOTE** Async event subscribers are queued only after the current transaction has commited so when using `assert_enqued_async_subcriber` in rails
**NOTE** Async event subscribers are queued only after the current transaction has committed so when using `assert_enqued_async_subcriber` in rails
make sure to have `self.use_transactional_fixtures = false` at the top of your test class.

**NOTE:** You must have `rspec-rails` gem in your bundle to use `have_enqueued_async_subscriber_for` matcher.
Expand All @@ -199,7 +199,7 @@ To test event publishing, use `have_published_event` matcher:
expect { subject }.to have_published_event(ProfileCreated).with(user_id: user.id)

# minitest
assert_event_published(ProfileCreated, with: { user_id: user.id }) { subject }
assert_event_published(ProfileCreated, with: {user_id: user.id}) { subject }
```

**NOTE:** `have_published_event` and `assert_event_published` only supports block expectations.
Expand Down
44 changes: 44 additions & 0 deletions gemfiles/rubocop.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
GEM
specs:

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
parallel (1.21.0)
parser (3.0.2.0)
ast (~> 2.4.1)
rainbow (3.0.0)
regexp_parser (2.1.1)
rexml (3.2.5)
rubocop (1.20.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.9.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.11.0)
parser (>= 3.0.1.1)
rubocop-md (1.0.1)
rubocop (>= 1.0)
rubocop-performance (1.11.5)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.11.0)
standard (1.3.0)
rubocop (= 1.20.0)
rubocop-performance (= 1.11.5)
unicode-display_width (2.1.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
rubocop-md (~> 1.0)!
standard (~> 1.0)!

BUNDLED WITH
2.2.16
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def event_type_matches?(event_class, event)
event_class.identifier == event.event_type
end

def event_data_matches?(attributes = nil, event)
def event_data_matches?(attributes, event)
(attributes.nil? || attributes.all? { |k, v| v == event.public_send(k) })
end
end
Expand Down

0 comments on commit b0f8228

Please sign in to comment.