Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

When I18n.get receives an invalid iso_code it doesn't raises error accordingly #309

Open
abinoam opened this issue Jun 15, 2014 · 2 comments

Comments

@abinoam
Copy link
Contributor

abinoam commented Jun 15, 2014

Gherkin::I18n.get('non-valid-iso_code')

doesn't raises an error.

I'm working on specs and fix. PR soon.

@abinoam
Copy link
Contributor Author

abinoam commented Jun 15, 2014

When trying to do

$ cucumber --i18n pt-BR

I got

undefined method `[]' for nil:NilClass (NoMethodError)
/Users/abinoam/.rvm/gems/ruby-2.1.0/gems/gherkin-2.12.2/lib/gherkin/i18n.rb:93:in `initialize'
/Users/abinoam/.rvm/gems/ruby-2.1.0/gems/gherkin-2.12.2/lib/gherkin/i18n.rb:25:in `new'
/Users/abinoam/.rvm/gems/ruby-2.1.0/gems/gherkin-2.12.2/lib/gherkin/i18n.rb:25:in `get'
/Users/abinoam/.rvm/gems/ruby-2.1.0/gems/cucumber-1.3.15/lib/cucumber/cli/options.rb:412:in `list_keywords_and_exit'
/Users/abinoam/.rvm/gems/ruby-2.1.0/gems/cucumber-1.3.15/lib/cucumber/cli/options.rb:159:in `block (2 levels) in parse!'

abinoam added a commit to abinoam/gherkin that referenced this issue Jun 15, 2014
@abinoam
Copy link
Contributor Author

abinoam commented Jun 15, 2014

After the fix I will get:

$ cucumber --i18n pt-BR
Language not supported: "pt-BR" (RuntimeError)
/Users/abinoam/src/gherkin/lib/gherkin/i18n.rb:92:in `initialize'
/Users/abinoam/src/gherkin/lib/gherkin/i18n.rb:25:in `new'
/Users/abinoam/src/gherkin/lib/gherkin/i18n.rb:25:in `get'
/Users/abinoam/.rvm/gems/ruby-2.0.0-p247@cucumber/gems/cucumber-1.3.15/lib/cucumber/cli/options.rb:412:in `list_keywords_and_exit'
/Users/abinoam/.rvm/gems/ruby-2.0.0-p247@cucumber/gems/cucumber-1.3.15/lib/cucumber/cli/options.rb:159:in `block (2 levels) in parse!'

abinoam added a commit to abinoam/gherkin that referenced this issue Jun 16, 2014
abinoam added a commit to abinoam/gherkin that referenced this issue Jun 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant