Skip to content

Commit

Permalink
i18n_tasks_spec: ignore Ruby 2.4 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Dec 26, 2016
1 parent a4efe98 commit 9949bdf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions spec/i18n_tasks_spec.rb
Expand Up @@ -14,22 +14,25 @@
# These bin/i18n-tasks tests are executed in parallel for performance
env = {'I18N_TASKS_BIN_SIMPLECOV_COVERAGE' => '1'}
in_test_app_dir do
clean_parser_warning = -> s { s.sub %r(\Awarning: parser/current.*?https://github.com/whitequark/parser#compatibility-with-ruby-mri.\n)m, '' }
clean_unrelated_warnings = -> s {
s.sub(%r(^warning: parser/cur.*?https://github.com/whitequark/parser#compatibility-with-ruby-mri\.\n)m, '')
.gsub(/^.*warning: constant ::(?:Fixnum|Bignum) is deprecated\n/, '')
}
clean_coverage_logging = -> s { s.sub /(?:\n^|\A)(?:Coverage = |.*Reporting coverage).*(?:$\n|\z)/i, '' }
[
proc {
out, err, status = Open3.capture3(env, 'bundle exec ../../bin/i18n-tasks')
out, err = clean_coverage_logging[out], clean_parser_warning[clean_coverage_logging[err]]
out, err = clean_coverage_logging[out], clean_unrelated_warnings[clean_coverage_logging[err]]
expect(status).to be_success
expect(out).to be_empty
expect(err).to start_with('Usage: i18n-tasks [command] [options]')
expect(err.lines.first.chomp).to eq('Usage: i18n-tasks [command] [options]')
expect(err).to include('Available commands', 'add-missing')
# a task from a plugin
expect(err).to include('greet')
},
proc {
out, err, status = Open3.capture3(env, 'bundle exec ../../bin/i18n-tasks --version')
out, err = clean_coverage_logging[out], clean_parser_warning[clean_coverage_logging[err]]
out, err = clean_coverage_logging[out], clean_unrelated_warnings[clean_coverage_logging[err]]
expect(status).to be_success
expect(err).to be_empty
expect(out.chomp).to eq I18n::Tasks::VERSION
Expand Down

0 comments on commit 9949bdf

Please sign in to comment.