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

Support requiring an exact match for validation errors #70

Merged
merged 7 commits into from
Sep 22, 2023

Conversation

deiwin
Copy link
Contributor

@deiwin deiwin commented Sep 22, 2023

This allows writing more thorough tests, where unexpected failures will
cause tests to fail when .exactly is added to the chain.

QVA-182

Without this the tests were failing for me with the following error.
Upgrading Pry to latest fixed this.

```
Failure/Error: require 'pry'

NameError:
  undefined method `=~' for class `Pry::Code'
```

QVA-182
The exact same `failure` is already specified in a `let` within this
`context` and is used by all other tests in this `context`.
This allows writing more thorough tests, where unexpected failures will
cause tests to fail when `.exactly` is added to the chain.

QVA-182
@deiwin deiwin requested review from riiwo and a team September 22, 2023 07:44
This allows quick validation + documentation without having to set up
seprate modules and test files.

QVA-182
Move the functions to class functions to avoid having to create some
sort of an instance within the doctets.

Diff best viewed with whitespace ignored.

QVA-182
Copy link
Contributor

@riiwo riiwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Have not used doctests before, where are the tests being run?

@deiwin
Copy link
Contributor Author

deiwin commented Sep 22, 2023

where are the tests being run?

They are run right after rspec tests in the Run tests step in CI (the CI workflow triggers the :default rake task which triggers both rspec and doctests tasks). E.g. here:

[warn]: in YARD::Handlers::Ruby::MixinHandler: Undocumentable mixin: 
...

Run options: --seed 61028

# Running:

......

Finished in 0.009383s, 639.4282 runs/s, 852.5709 assertions/s.

6 runs, 8 assertions, 0 failures, 0 errors, 0 skips

@deiwin deiwin merged commit 9790ab2 into master Sep 22, 2023
6 checks passed
@deiwin deiwin deleted the QVA-182/allow_exact_match branch September 22, 2023 13:25
@deiwin
Copy link
Contributor Author

deiwin commented Sep 22, 2023

They can also be run locally with bundle exec yard doctest

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

Successfully merging this pull request may close these issues.

None yet

3 participants