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

empty string is causing NoMethodError rather than Ingreedy::ParseFailed #34

Open
matkoniecz opened this issue Oct 19, 2016 · 0 comments

Comments

@matkoniecz
Copy link

I would expect

require 'ingreedy'

Ingreedy.parse('')

to throw Ingreedy::ParseFailed rather than NoMethodError

/home/mateusz/.gem/ruby/2.3.0/gems/ingreedy-0.1.0/lib/ingreedy/unit_variation_mapper.rb:31:in `unit_from_variation': undefined method `first' for nil:NilClass (NoMethodError)
    from /home/mateusz/.gem/ruby/2.3.0/gems/ingreedy-0.1.0/lib/ingreedy/ingreedy_parser.rb:55:in `convert_unit_variation_to_canonical'
    from /home/mateusz/.gem/ruby/2.3.0/gems/ingreedy-0.1.0/lib/ingreedy/ingreedy_parser.rb:39:in `parse'
    from /home/mateusz/.gem/ruby/2.3.0/gems/ingreedy-0.1.0/lib/ingreedy.rb:16:in `parse'
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

No branches or pull requests

1 participant