Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: collections matchers should display type of expectation #408

Merged
merged 1 commit into from
Feb 1, 2021

Commits on Jan 31, 2021

  1. fix: collections matchers should display type of expectation

    The collections matchers ConsistOf() and ContainElements() are often
    used with collections of consistent type, for example:
    
    Expect(t).To(ConsistOf(1, 2, 3))
    
    When this fails, it's more helpful to report:
    
       ...to contain elements <[]int | len:3, cap:3>: [1, 2, 3]
    
    Than the previous behavior:
    
       ...to contain elements <[]interface {} | len:3, cap:3>: [1, 2, 3]
    
    By using []interface{} only where there's no other option we make it
    easier to debug issues - especially for types that display identically.
    blgm committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    f59870f View commit details
    Browse the repository at this point in the history