icy-arctic-fox / spectator

Feature-rich testing framework for Crystal inspired by RSpec.
https://gitlab.com/arctic-fox/spectator
MIT License
103 stars 5 forks source link

Example of custom matcher does not compile #46

Closed gmartsenkov closed 2 years ago

gmartsenkov commented 2 years ago

The example here fails to compile - https://github.com/icy-arctic-fox/spectator/wiki/Custom-Matchers It fails with Error: undefined constant ::Spectator::TestValue.
Tried changing that to Spectator::Value which seems to be the new name but that fails with:

no overload matches 'MultipleOfMatcher(ExpectedType).new' with type Spectator::Value(Int32)

Also thanks for the wonderful library you've built!

icy-arctic-fox commented 2 years ago

There were a couple of issues here.

  1. The docs for custom matchers were outdated and referenced old types. The Test prefix was dropped a while ago. The docs have been updated to reflect this.
  2. For some reason, Spectator::Value(T) was not resolving properly when defining a matcher outside of the Spectator module.

The second issue should be resolved in the latest release (v0.11.3).

If this issue isn't resolved, please reopen. Thanks!