-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
HOLD: Add tests for brew cask search
when casks have the same token
#7906
Conversation
…kens When multiple casks (from separate repos) have identical tokens, the `brew cask search` command sometimes gets confused. The search results then show one of the qualified tokens multiple times while the other qualified tokens are missing. This commit merely adds failing tests to illustrate the issue.
Thanks for the pointer @radeksimko! @rolandwalker had already told me about the plans of transitioning to RSpec … I wasn’t aware though that we’re already free to use it 😊 |
We are already supposed to use RSpec, but I need to be taught and/or led into it. I have only minimal understanding of minitest, and just fake it by copying other examples. |
As to the substance of the proposal, it sounds good and certainly fixes a bug. Some people might prefer to always hide the canonical Caskroom tap, eg $ brew cask search firefox
==> Exact match
firefox
==> Partial matches
other/repo/firefox multifirefox so you might want to gather opinions. My vote would go for your original proposal. We do avoid creating colliding tokens anywhere across our repos, but a user has the freedom to create one and we ought to support that. It's worth noting that, however the token is specified at the CLI, An alternative arrangement which would allow multiple |
I like the idea of more different versions of the same app from different repos and I think we should be supporting it, but it's just worth noticing, that the whole problem gets a bit more complicated with shared namespace in |
Looks interesting. Will take a look over the next day or two. On Tuesday, December 9, 2014, Radek Simko [email protected] wrote:
|
This PR adds failing tests for just one more edge case I’ve encountered.
Issue
When two or more Casks (from separate repos) have the same token, the
brew cask search
command can get a bit confused.I’m not really sure if we’re committed to supporting this in the first place. However, we have a method
Cask::CLI::nice_listing
which suggests that we are.For this discussion, let’s suppose a user has tapped into a repo called
other/repo
which happens to carry anotherfirefox
. (This PR includes a Cask like this in case you want to have a look.)Current behavior
Now that either repo has a
firefox
, the commandbrew cask search fire
yields:with
caskroom/cask/firefox
listed twice whileother/repo/firefox
is missing.Similarly,
brew cask search firefox
yields:with only one match, but
other/repo/firefox
still missing.Proposed behavior
Instead, I’d expect
brew cask search fire
to yield:and
brew cask search firefox
to yield something like this:Please do NOT merge
I only created this PR to have a place for the failing tests … and to kindly ask for your thoughts about them.
The upcoming version of
brew cask search
already implements what the Proposed section says. Still, I’d love some feedback from the @caskroom/maintainers … does the proposed behavior make sense?