Skip to content

Commit

Permalink
Only activate i18n-tasks on Ruby >= 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Feb 1, 2016
1 parent 09e4bca commit 0cd9fd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -101,7 +101,7 @@ group :development do
gem 'guard-rspec'
gem 'quiet_assets'

gem 'i18n-tasks', '~> 0.9.1'
gem 'i18n-tasks', '~> 0.9.1' if RUBY_VERSION >= '2.1'
end

group :test do
Expand Down
4 changes: 3 additions & 1 deletion spec/i18n_spec.rb
@@ -1,17 +1,19 @@
require 'i18n/tasks'
require 'i18n/tasks' if RUBY_VERSION >= '2.1'

RSpec.describe 'I18n' do
let(:i18n) { I18n::Tasks::BaseTask.new }
let(:missing_keys) { i18n.missing_keys }
let(:unused_keys) { i18n.unused_keys }

it 'does not have missing keys' do
skip unless RUBY_VERSION >= '2.1'
expect(missing_keys).to(be_empty,
"Missing #{missing_keys.leaves.count} i18n keys, " \
"run `i18n-tasks missing' to show them")
end

it 'does not have unused keys' do
skip unless RUBY_VERSION >= '2.1'
expect(unused_keys).to(be_empty,
"#{unused_keys.leaves.count} unused i18n keys, " \
"run `i18n-tasks unused' to show them")
Expand Down

0 comments on commit 0cd9fd1

Please sign in to comment.