Skip to content

Commit

Permalink
Cover warn method
Browse files Browse the repository at this point in the history
  • Loading branch information
jaynetics committed Apr 23, 2023
1 parent 817bc15 commit 9c912c3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/delete_recursively_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,13 @@
.and change { Comment.count }.from(2).to(1)
end
end

describe 'DeleteRecursively::AssociatedClassFinder.warn_empty_result' do
it 'works' do
ref = Blog.reflect_on_all_associations.find { |r| r.name == :posts } || fail
expect do
DeleteRecursively::AssociatedClassFinder.send(:warn_empty_result, ref)
end.to output(/Blog#posts/).to_stderr
end
end
end

0 comments on commit 9c912c3

Please sign in to comment.