Fix canonicalize_resource to only match resources with same namevar #508
9341e04 introduced a regression when using matchers to check that a
The following example would fail if any
The method passed a block to #first rather than #find in order to filter
Fix nil error for irretrievable
When iterating over
9341e04 introduced a regression when using matchers to check that a resource reference doesn't exist, as the matcher will find a resource of the same type but with a different namevar/title. The following example would fail if any `Bar` resource exists, as the title in the `Bar[unknown]` resource reference would be ignored: is_expected.not_to contain_foo("foo").that_requires("Bar[unknown]") The method passed a block to #first rather than #find in order to filter by the namevar, but the block is unused.
When iterating over `@catalogue.resource_keys`, a builtin `Class[main]` resource is returned, but isn't accessible through `#resource`, causing a nil entry in the list of matched resources. The array of resources is now compacted to remove inaccessible builtin resources, which fixes an error when using `Class` resources in relationship matchers.