Skip to content

Better error message for 'wrong number of arguments (given 0, expected 1)' #32

@professor

Description

@professor

Feel free to close this issue if we don't want to solve it. I'm including it here to help the next person who sees this error message, which might be me =)

In my haste to use this gem, I didn't carefully look at the examples.

When I read this following line, I thought that I could use %{advises} for It.it when I really need to pass a label for the link %{link:**label**}. In my one of cases, my label for my link is the same text as the link, so I assumed it was optional.

en:
  copy: "Read the %{guide:Rails I18n guide} for more than %{advises} advises.

My code done in haste:

It.it "example", link: "https://example.com"

en:
  example:
    Go see %{link}'

This will give the error: 'wrong number of arguments (given 0, expected 1)'

Correct code:

It.it "example", link: "https://example.com"

en:
  example:
    'Go see %{link:https://example.com}.'

Perhaps the code could detect this situation and give a better error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions