Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Feature/rework matcher #1076
Feature/rework matcher #1076
Conversation
|
@lwasylow - sorry for not reviewing it yet. |
| l_result ut_equal := self; | ||
| begin | ||
| l_result.options.include.add_items(a_items); | ||
| l_result.expectation.to_(l_result ); |
jgebal
Jun 13, 2020
Member
I think we need some sort of exception handling.
The syntax that is will work perfectly well are:
ut.expect( l_refcursor ).to_( equal(l_refcursor).include( ... ) );ut.expect( l_refcursor ).to_equal(l_refcursor).include( ... );
It is however possible to call:
exec equal(l_refcursor).include( ...);
In this case, the code will fail dramatically even though it is possible to make a call like this.
Instead of throwing an un-handled exception we should throw a user-friendly one.
Something like:
ORA-20000 - utPLSQL matcher can only be called as part of expectation. Instead of calling equal( ... ).include( ... ); , call ut.expect( ... ).to_( equal( ... ).include( ... ) );
Not sure what exact error should be but definitely something that can help users understand their mistake.
| l_result ut_equal := self; | ||
| begin | ||
| l_result.options.exclude.add_items(a_items); | ||
| l_result.expectation.to_(l_result ); |
jgebal
Jun 13, 2020
Member
all calls to: l_result.expecatation in this type are assuming that the expectation attribute is set.
jgebal
Jun 13, 2020
Member
Given the number of places this is called, it would be good to delegate exception handling to a helper procedure.
Added synonym and grant for matcher Reworked expectation to work fine with syntax `to_( matcher() )` for to_be_within. TODO - add tests for other matchers with `to_( matcher )` and `not_to( matcher )` syntax
…tPLSQL into feature/rework_matcher
Reorganized code so that `be_within_pct` is only supported for `number` Added tests for non-supported syntax
No tests
|
Kudos, SonarCloud Quality Gate passed!
|
|
What's missing here? Maybe I can help |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Adding a matcher within_of.
Rework some of the compound expectation to use a pass a matcher to expectation to remove methods from ut_equal_compound.
Implements #77