Sha256: dc06c58699d165b592582df480af54b88013e2b17255eb5ebc5b9643e53dd8a3

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

require 'spec_helper'

RSpec.describe 'Data commands' do
  delegate :run_cmd, to: :TestCodebase

  describe '#add_missing' do
    describe 'adds the missing keys to base locale first, then to other locales' do
      around do |ex|
        TestCodebase.setup(
            'config/i18n-tasks.yml' => {base_locale: 'en', locales: %w(es fr)}.to_yaml,
            'config/locales/es.yml' => {'es' => {'a' => 'A'}}.to_yaml)
        TestCodebase.in_test_app_dir { ex.call }
        TestCodebase.teardown
      end

      it 'with -v argument' do
        run_cmd 'add-missing', '-vTRME'
        expect(YAML.load_file('config/locales/en.yml')).to eq('en' => {'a' => 'TRME'})
        expect(YAML.load_file('config/locales/fr.yml')).to eq('fr' => {'a' => 'TRME'})
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i18n-tasks-0.8.7 spec/commands/missing_commands_spec.rb