Skip to content

Commit

Permalink
Use yield instead of &block on the #deterministically_verify helper
Browse files Browse the repository at this point in the history
  • Loading branch information
erichmachado committed Sep 15, 2023
1 parent afa915e commit 48771fd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/test_helper.rb
Expand Up @@ -31,12 +31,10 @@
# assert subject.match(/(bo(_|\.)peep|peep(_|\.)bo)/)
# end
#
def deterministically_verify(subject_proc, depth: 2, random: nil, &block)
raise 'need block' unless block_given?

def deterministically_verify(subject_proc, depth: 2, random: nil)
results = depth.times.map do
Faker::Config.stub :random, random.clone || Random.new(42) do
subject_proc.call.freeze.tap(&block)
yield subject_proc.call.freeze
end
end

Expand Down

0 comments on commit 48771fd

Please sign in to comment.