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

When raising MismatchError, use cleaned value #84

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

d12
Copy link
Contributor

@d12 d12 commented Mar 8, 2018

When raising MismatchError, use the cleaned value in the error message instead of the uncleaned value.

This way, error messages are more helpful when observation values are large ruby objects!

TDD - Error after adding test but before changing implementation to cleaned_value

# Running:

.............................................F.................................

Finished in 0.278490s, 283.6727 runs/s, 563.7545 assertions/s.

  1) Failure:
Scientist::Experiment::raising on mismatches#test_0002_cleans values when raising on observation mismatch [test/scientist/experiment_test.rb:402]:
Expected /So Clean/ to match "experiment 'experiment' observations mismatched:\ncontrol:\n  \"fine\"\ncandidate:\n  \"not fine\"\n".

cc @zerowidth

@coveralls
Copy link

coveralls commented Mar 8, 2018

Coverage Status

Coverage remained the same at 99.07% when pulling f9c9d71 on use_cleaned_value_in_mismatch_error into a9a458d on master.

@zerowidth zerowidth merged commit bdf964f into master Mar 8, 2018
@zerowidth zerowidth deleted the use_cleaned_value_in_mismatch_error branch March 8, 2018 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants