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

Print friendly error for Thor::AmbiguousTaskError #2581

Merged
merged 5 commits into from
Aug 6, 2013
Merged

Print friendly error for Thor::AmbiguousTaskError #2581

merged 5 commits into from
Aug 6, 2013

Conversation

jlsuttles
Copy link
Contributor

Fixes #2550

jendiamond and others added 4 commits August 5, 2013 14:12
move the dispatch integration specs into other

load friendly_errors so we can unit test it

require Thor so we can rescue the errors

bump ArgumentError above Exception so it wins
overrides Thor#start in Bundler::CLI to ensure Bundler.ui is set to UI::Shell.new

fixes typo in friendly error message

only sets UI::Sell.new in Bundler::CLI#start if exception is raised

fixes typo in lib

adds more specs

rescues Thor::AmbiguousTaskError instead of ArgumentError

removes message from spec as it's not needed
bundle "install"
expect(err).to eq("")
expect(out).to match(/Bundler::GemfileNotFound/)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is a good spec or not. The command is being dispatched correctly, but is not actually successful. Should the Gemfile be setup? Same for the next one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably just add expect(out).to_not match(/ambiguous command/i) or whatever is appropriate.

@indirect
Copy link
Member

indirect commented Aug 6, 2013

👍 :shipit:

indirect added a commit that referenced this pull request Aug 6, 2013
…s-task

Print friendly error for Thor::AmbiguousTaskError
@indirect indirect merged commit 5181d3b into rubygems:master Aug 6, 2013
@jlsuttles jlsuttles deleted the print-friendly-error-ambiguous-task branch August 6, 2013 02:00
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.

Print friendly error on ambiguous command
4 participants