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

Higher order callable datasets #352

Merged
merged 5 commits into from
Jul 21, 2021
Merged

Conversation

lukeraymonddowning
Copy link
Member

@lukeraymonddowning lukeraymonddowning commented Jul 21, 2021

Q A
Bug fix? no
New feature? yes

Howdy all!

Something that came up in the stream yesterday was the inability to combine higher order tests with datasets. For simplistic tests, this can be quite frustrating.

This PR updates the higher order callable methods so that they always receive dataset values if available:

it('should throw an InvalidArgumentException')
    ->with('invalidNames')
    ->throws(InvalidArgumentException::class)
    ->tap(fn($name) => ValidatesModuleName::handle($name));

it('converts the markdown to html')
    ->with('markdownExamples')
    ->expect(fn($markdown) => MarkdownToHtml::convert($markdown))
    ->toBeString()
    ->toStartWith('<p>');

Kind Regards,
Luke

@Gummibeer
Copy link
Contributor

The Luke-Bot strikes again! 🥳
Provide an idea to Luke and he will make it happen. 😅

@JustSteveKing
Copy link

This makes me happy! Such an awesome idea!

@nunomaduro nunomaduro merged commit 51f5567 into master Jul 21, 2021
@nunomaduro
Copy link
Member

Feel free to merge, release, and tweet.

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

Successfully merging this pull request may close these issues.

4 participants