Skip to content

Commit

Permalink
Google Translate fixnum spec #100
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Oct 22, 2014
1 parent 0de35a4 commit cffbeb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/commands/data_commands_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def en_data_2
end

it '#data' do
expect(JSON.parse(run_cmd :data, format: 'json')).to eq(en_data)
expect(JSON.parse(run_cmd :data, format: 'json', locales: 'en')).to eq(en_data)
end

it '#data-merge' do
Expand Down
9 changes: 6 additions & 3 deletions spec/google_translate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
nil_value_test = ['nil-value-key', nil, nil],
text_test = ['key', "Hello - %{user} O'neill!", "Hola - %{user} O'neill!"],
html_test = ['html-key.html', "Hello - <b>%{user} O'neill</b>", "Hola - <b>%{user} O'neill</b>"],
array_test = ['array-key', ['Hello.', nil, '', 'Goodbye.'], ['Hola.', nil, '', 'Adiós.']]
array_test = ['array-key', ['Hello.', nil, '', 'Goodbye.'], ['Hola.', nil, '', 'Adiós.']],
fixnum_test = ['numeric-key', 1, 1],
]

if ENV['GOOGLE_TRANSLATE_API_KEY']
Expand Down Expand Up @@ -45,7 +46,8 @@
'hello' => text_test[1],
'hello_html' => html_test[1],
'array_key' => array_test[1],
'nil-value-key' => nil_value_test[1]
'nil-value-key' => nil_value_test[1],
'fixnum-key' => fixnum_test[1]
}
})
task.data[:es] = build_tree('es' => {
Expand All @@ -58,7 +60,8 @@
expect(task.t('common.hello', 'es')).to eq(text_test[2])
expect(task.t('common.hello_html', 'es')).to eq(html_test[2])
expect(task.t('common.array_key', 'es')).to eq(array_test[2])
expect(task.t('nil-value-key', 'es')).to eq(nil_value_test[2])
expect(task.t('common.nil-value-key', 'es')).to eq(nil_value_test[2])
expect(task.t('common.fixnum-key', 'es')).to eq(fixnum_test[2])
expect(task.t('common.a', 'es')).to eq('λ')
end
end
Expand Down

0 comments on commit cffbeb0

Please sign in to comment.