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

Failure when AnyFixture reporting is enabled but AnyFixture has not been used. #166

Closed
Systho opened this issue Oct 28, 2019 · 0 comments
Closed
Labels

Comments

@Systho
Copy link

Systho commented Oct 28, 2019

https://github.com/palkan/test-prof/blob/e135f2df9fff257d7c3944707f46bb960373528c/lib/test_prof/any_fixture.rb#L90

When reporting is enabled, AnyFixture will introspect its cache after suite has run.
But if AnyFixture has not been used, the cache will be empty and this will return nil :

cache.stats.keys.map(&:size).max

Then nil + 2 will throw an error.

I think the report_stats method should return immediately if cache is empty with a simple message "No AnyFixture Stats available".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants