test/wwwjdic/locales/test_locales.rb in wwwjdic-13.0.1 vs test/wwwjdic/locales/test_locales.rb in wwwjdic-14.0.0
- old
+ new
@@ -1,8 +1,8 @@
#--
# wwwjdic
-# Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani
+# Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
#
# This file is part of wwwjdic.
#
# wwwjdic is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -27,20 +27,20 @@
before do
I18n.load_path = Dir[File.join(File.dirname(__FILE__), RELATIVE_PATH, '*.yml')]
end
- subject {I18n.available_locales}
+ subject { I18n.available_locales }
it 'shall return at least one available locale' do
- subject.wont_be_nil
- subject.wont_be_empty
+ _(subject).wont_be_nil
+ _(subject).wont_be_empty
end
it 'shall contain at least English and Italiano' do
- subject.must_include :en
- subject.must_include :it
+ _(subject).must_include :en
+ _(subject).must_include :it
end
it 'shall contain a test.test signpost for each available locale' do
def load_yaml_file(locale)
filename = File::join(File::dirname(__FILE__), RELATIVE_PATH, "#{locale}.yml")
@@ -50,16 +50,16 @@
subject.each do |locale|
I18n.locale = locale
translation = load_yaml_file(locale)
- translation["#{locale}"]['test']['test'].wont_be_nil
+ _(translation["#{locale}"]['test']['test']).wont_be_nil
a_string = I18n.t('test.test')
- a_string.wont_be_nil
- a_string.wont_be_empty
- a_string.wont_include 'translation missing'
- a_string.must_equal translation["#{locale}"]['test']['test']
+ _(a_string).wont_be_nil
+ _(a_string).wont_be_empty
+ _(a_string).wont_include 'translation missing'
+ _(a_string).must_equal translation["#{locale}"]['test']['test']
end
end
end
end