Skip to content

Commit

Permalink
Skip mutation testing AsyncRecord.
Browse files Browse the repository at this point in the history
AsyncRecord follows ActiveRecord API with regard to after_commit
callbacks.

This API has changed over releases we still support (4, 5,
6). Some of AsyncRecord record methods will not be called in some
ActiveRecord versions, yet mutant expects to remove those.

Introducing release-specific AsyncRecord class could have been the solution
but there will still be dead code from mutant perspective, that is all
classes not needed under current ActiveRecord version.

It does not seem to be the hill worth dying on.
  • Loading branch information
mostlyobvious committed Sep 30, 2019
1 parent 7aed924 commit f4edc10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion rails_event_store/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ GEM_VERSION = $(shell cat ../RES_VERSION)
GEM_NAME = rails_event_store
REQUIRE = $(GEM_NAME)
IGNORE = RailsEventStore::Client\#initialize \
RailsEventStore::AfterCommitAsyncDispatcher::AsyncRecord\#rolledback!
RailsEventStore::AfterCommitAsyncDispatcher::AsyncRecord* \
RailsEventStore::AfterCommitAsyncDispatcher\#async_record
SUBJECT ?= RailsEventStore*
DATABASE_URL ?= sqlite3::memory:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ def run(&schedule_proc)
transaction = ActiveRecord::Base.connection.current_transaction

if transaction.joinable?
transaction.add_record(
AsyncRecord.new(self, schedule_proc)
)
transaction.add_record(async_record(schedule_proc))
else
yield
end
end

def async_record(schedule_proc)
AsyncRecord.new(self, schedule_proc)
end

def verify(subscriber)
@scheduler.verify(subscriber)
end
Expand Down

0 comments on commit f4edc10

Please sign in to comment.