Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Add ray() #13

Merged
merged 4 commits into from
Jun 10, 2021
Merged

Add ray() #13

merged 4 commits into from
Jun 10, 2021

Conversation

freekmurze
Copy link
Contributor

@freekmurze freekmurze commented Jun 7, 2021

This PR adds a function ray() that makes it easy to display values under test in Ray.

A test was added to prove that it will not throw an exception when Ray is not installed and to prove that ray() is chainable.

I've not added spatie/ray as a dependency to keep the dev-requirements as light as they can be.

It could be questioned if a function for a paid product belongs in this package. I think it does because:

  • the maintenance burden is minimal
  • if we would use a Pest plugin, Pest users would not see ray() in the autocompletion of the IDE.

@nedwors
Copy link
Contributor

nedwors commented Jun 7, 2021

Would it be possible to allow parameters to be passed to ray along with the expectation value? 🙂

@freekmurze
Copy link
Contributor Author

@nedwors nice idea, done!

@felixdorn
Copy link

I've nothing against Ray, it seems like a great debugging tool.

I think that your reasoning is a bit flawed: what actually needs to be added is the ability for the Pest Intellij Plugin to autocomplete extensions of the Expectation class.

Let's say that this PR gets merged, where is the limit of paid products integrated in Pest? Can anyone just add their 15 lines of code for the tool they're using? This would make the maintenance cost pretty big, quickly.

Another solution would be to choose which tools can have a first party integration in Pest but, is it really fair to do so and on what would it be based on?

This should just be a plugin, really. Did you PR directly to Laravel's core for Collection->ray,...? No! You made a package and you don't have macros autocompleted for that package either (without external tools)! So why would you PR that to Pest's core 🤔 ?

Here are just my two cents but of course at the end of the day it's up to Nuno to decide.

@owenvoke
Copy link
Member

owenvoke commented Jun 7, 2021

I feel like this might be better as a package instead of in Pest core, but that would possibly be kind of overkill for a package (being literally just a couple of lines for the Expectation macro). 🤔 However, this also doesn't really cause any issues for anyone not using Ray, so I'll leave this for Nuno to decide on whether it should be merged. 👍🏻

@nunomaduro nunomaduro merged commit 3862d5c into pestphp:master Jun 10, 2021
@nunomaduro
Copy link
Member

This looks good to me. I personally use ray so this makes sense to me.

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

Successfully merging this pull request may close these issues.

5 participants