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

Reversing MiniTest::Spec expectations does not work. #1

Open
jdickey opened this issue Jul 26, 2016 · 2 comments
Open

Reversing MiniTest::Spec expectations does not work. #1

jdickey opened this issue Jul 26, 2016 · 2 comments
Assignees

Comments

@jdickey
Copy link
Contributor

jdickey commented Jul 26, 2016

Using the existing must_require_initialize_parameter MiniTest::Spec wrapper around MiniTest::Assertions:: AssertRequiresInitializeParameter, we can have a positive expectation, but the use of :reverse to enable negative expectations does not appear to be operative.

That is,

    expect(SomeClass).must_require_initialize_parameter params, :some_param

works as expected, but

    expect(SomeClass).wont_require_initialize_parameter params, :bogus_param

raises a NoMethodError. In the context of this particular matcher, the use of a negative expectation should be very rare, but having it just not work will be surprising behaviour to the user.

@jdickey
Copy link
Contributor Author

jdickey commented Oct 18, 2016

We misunderstood the MiniTest documentation and source; reversing (refuting) an assertion isn't controlled by the last parameter on infect_an_assertion; it's implemented using a second, reverse-logic assertion. 😖

Fix coming shortly.

@jdickey
Copy link
Contributor Author

jdickey commented Oct 18, 2016

The current implementation of assert_required_static_call_param actively verifies that the specified key occurs in the valid parameters for the subject class' .call method. This isn't a ten minute fix; kicking it down the calendar until resources permit or priorities demand.

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

No branches or pull requests

1 participant