Skip to content

Add spec for delegating to the original instance method w/in the block implementation

Created by: padi

In this example String#slice was replaced within the block with String#[]. In some cases, you don't have to luxury of having an equivalent method to rely on. Sometimes, you just want to use the same method within the block and include some assertions before it (or do something else if you wanted to).

This example clears that up. Hopefully it will save someone a few minutes/hours. :) Didn't know UnboundMethod in ruby before.

Merge request reports