spec/i18n_tasks_spec.rb in i18n-tasks-0.8.7 vs spec/i18n_tasks_spec.rb in i18n-tasks-0.9.0.rc1
- old
+ new
@@ -1,6 +1,5 @@
-# coding: utf-8
require 'spec_helper'
require 'fileutils'
require 'open3'
# Integration tests
@@ -8,10 +7,11 @@
delegate :run_cmd, :run_cmd_capture_stdout_and_result, :run_cmd_capture_stderr, :i18n_task, :in_test_app_dir,
to: :TestCodebase
describe 'bin/i18n-tasks' do
it 'shows help when invoked with no arguments, shows version on --version' do
+ next if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
# These bin/i18n-tasks tests are executed in parallel for performance
in_test_app_dir do
[
proc {
out, err, status = Open3.capture3('../../bin/i18n-tasks')
@@ -21,11 +21,11 @@
expect(err).to include('Available commands', 'add-missing')
# a task from a plugin
expect(err).to include('greet')
},
proc {
- expect(%x[../../bin/i18n-tasks --version].chomp).to eq(I18n::Tasks::VERSION)
+ expect(%x[bundle exec ../../bin/i18n-tasks --version].chomp).to eq(I18n::Tasks::VERSION)
}
].map { |test| Thread.start(&test) }.each(&:join)
end
end
end
@@ -96,12 +96,12 @@
%w(en es).map { |l| "#{l}.#{k}" }
end.reduce(:+)
end
describe 'unused' do
- it 'detects unused' do
- out, result = run_cmd_capture_stdout_and_result 'unused'
+ it 'detects unused (--no-strict)' do
+ out, result = run_cmd_capture_stdout_and_result('unused', '--no-strict')
expect(result).to eq :exit_1
expect(out).to be_i18n_keys expected_unused_keys
end
it 'detects unused (--strict)' do
@@ -207,20 +207,9 @@
}
run_cmd 'add-missing', '-v', 'TRME %{value}'
in_test_app_dir {
expect(YAML.load_file('config/locales/es.yml')['es']['missing_in_es']['a']).to eq 'TRME EN_TEXT'
expect(YAML.load_file('config/locales/en.yml')['en']['present_in_es_but_not_en']['a']).to eq 'TRME ES_TEXT'
- }
- end
-
- it '--value with %{key}' do
- in_test_app_dir {
- expect(YAML.load_file('config/locales/es.yml')['es']['missing_in_es']).to be_nil
- }
- run_cmd 'add-missing', '-v', 'TRME %{key}'
- in_test_app_dir {
- expect(YAML.load_file('config/locales/es.yml')['es']['missing_in_es']['a']).to eq 'TRME es.missing_in_es.a'
- expect(YAML.load_file('config/locales/en.yml')['en']['present_in_es_but_not_en']['a']).to eq 'TRME en.present_in_es_but_not_en.a'
}
end
end
describe 'config' do