Object#tap is great for creating scopes and defining a context. Here are some examples:
Initializers, such as configuring Braintree:
Notice that without the block, the settings variable would become global, which is bad.
In a template:
Assigning local variables inside of a template is a code smell. We can avoid doing so, and create a visual context around the variable with Object#tap. (This was first described by 37signals.)
Each tap block scopes the variable and shows a context. This could be split into multiple tests, but this is a nice way to have one test per method.