-
Notifications
You must be signed in to change notification settings - Fork 6
fix(parser): raise InvalidTaxCodeError when birthplace not found #72
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,9 +29,8 @@ class ParserTest < Minitest::Test | |
| end | ||
| end | ||
|
|
||
| # FIXME: This behaviour needs to be fixed, maybe by raising an InvalidTaxCodeError. | ||
| test "returns nil birthplace when the lookup on both cities and countries fails" do | ||
| assert_nil klass.new("BRRDRN70M41ZXXXE").decode[:birthplace] | ||
| test "raises InvalidTaxCodeError when birthplace code is not found in cities or countries" do | ||
| assert_raises(klass::InvalidTaxCodeError) { klass.new("BRRDRN70M41ZXXXE").decode } | ||
|
Comment on lines
+32
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Freeze time in this new decode test to keep it deterministic. This assertion exercises date-dependent decode logic ( As per coding guidelines: "Use 🤖 Prompt for AI Agents |
||
| end | ||
|
|
||
| test "raises NoTaxCodeError with an empty tax code" do | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidTaxCodeErrordocumentation is now incomplete across sections.The decode section was updated, but the Error Hierarchy still describes
InvalidTaxCodeErroronly as a length error; it should also mention unknown birthplace lookup failure for consistency.Based on learnings: "Whenever you modify code, check whether the change affects any section of this file ... and update the relevant section in the same commit."
🤖 Prompt for AI Agents