Skip to content

Fix Metadata#fetch to support computed values.

gitlab-qa-bot requested to merge github/fork/samwgoldman/fetch into master

Created by: samwgoldman

If example.metadata.fetch(:description) was called before example.metadata[:description], fetch would raise a KeyError.

My use case is a DSL built on top of RSpec. I want to be able to inject the example's metadata into a collaborator which treats the metadata like a normal hash. In order to fail fast, the collaborator calls fetch on the injected hash, which fails when the fetched key is, e.g., :description.

Let me know if you would like this tested/implemented differently.

Merge request reports