Module: Sqrbl::ExpectsBlockWithNew

Included in:
Group, Step, StepPair
Defined in:
lib/sqrbl/mixins/expects_block_with_new.rb

Overview

This module primarily exists to help with testing. It encapsulates the common pattern of a method on one object that takes a block, creates a new object, and passes the block to the new object.

In normal use, the new object should then immediately instance_eval the block; however, for testing, it is sometimes useful to delay block evaluation until later so we can set up mocking beforehand.

(Search the /spec directory for “skip_block_evaluation” for examples.)