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

Args contract failure message contains misleading argument position number #217

Open
waterlink opened this issue Jan 9, 2016 · 0 comments

Comments

@waterlink
Copy link
Collaborator

As seen by this scenario I am writing on different branch:

  Scenario: Rejects one invalid argument
    Given a file named "rejects_one_invalid_argument.rb" with:
    """ruby
    require "./args_usage"
    puts Example.new.only_nums(42, "foo", 17, 24)
    """
    When I run `ruby rejects_one_invalid_argument.rb`
    Then the output should contain:
    """
    : Contract violation for argument 1 of 4: (ParamContractError)
            Expected: (Args[Contracts::Builtin::Num]),
            Actual: "foo"
            Value guarded in: Example::only_nums
            With Contract: Args => Bool
    """

It should be either 1 of 1 (as in *args argument), or it should be 2 of 4 as in 2nd argument of all provided.

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

No branches or pull requests

1 participant