Sha256: 660c5c5edbe77418c444f92cae9b824808f371b0a91b32d45eda7bc85827659e

Contents?: true

Size: 1.64 KB

Versions: 18

Compression:

Stored size: 1.64 KB

Contents

require 'spec_helper'

describe Aigu::CoreExporter do
  describe :parse_java_file do
    let(:exporter) { Aigu::CoreExporter.new }
    let(:parse_java_file_en) { exporter.send(:parse_java_file, content) }
    let(:parse_java_file_fr) { exporter.send(:parse_java_file, content, 'fr') }

    let(:content) do
      <<-EOS.unindent
      package ca.bell.fiberemote.core;

      public enum CoreLocalizedStrings {

          /* !!LOCALIZED STRINGS!! --> */
          STRING_1("Value of string #1 en", "Value of string #1 fr"),
          STRING_2 ("Value of string #2 en", "Value of string #2 fr"),
          STRING_3("Value with quotes \\" and \\nlinefeeds en", "Value with quotes \\" and \\nlinefeeds fr"),
          STRING_4("Value with parentheses () en", "Value with parentheses () fr")
          /* <-- !!LOCALIZED STRINGS!! */
          ;

          private String textEn;

          CoreLocalizedStrings(String textEn) {
              this.textEn = textEn;
          }
      }
      EOS
    end

    let(:expected_content_en) do
      {
        'STRING_1' => 'Value of string #1 en',
        'STRING_2' => 'Value of string #2 en',
        'STRING_3' => 'Value with quotes \" and \nlinefeeds en',
        'STRING_4' => 'Value with parentheses () en'
      }
    end

    let(:expected_content_fr) do
      {
        'STRING_1' => 'Value of string #1 fr',
        'STRING_2' => 'Value of string #2 fr',
        'STRING_3' => 'Value with quotes \" and \nlinefeeds fr',
        'STRING_4' => 'Value with parentheses () fr'
      }
    end

    it { expect(parse_java_file_en).to eql expected_content_en }
    it { expect(parse_java_file_fr).to eql expected_content_fr }
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
aigu-1.2 spec/aigu/core_exporter_spec.rb
aigu-1.1.1 spec/aigu/core_exporter_spec.rb
aigu-1.1 spec/aigu/core_exporter_spec.rb
aigu-1.0.3 spec/aigu/core_exporter_spec.rb
aigu-1.0.2 spec/aigu/core_exporter_spec.rb
aigu-1.0.1 spec/aigu/core_exporter_spec.rb
aigu-1.0 spec/aigu/core_exporter_spec.rb
aigu-0.7 spec/aigu/core_exporter_spec.rb
aigu-0.6.1 spec/aigu/core_exporter_spec.rb
aigu-0.6 spec/aigu/core_exporter_spec.rb
aigu-0.5.1 spec/aigu/core_exporter_spec.rb
aigu-0.5 spec/aigu/core_exporter_spec.rb
aigu-0.4.5 spec/aigu/core_exporter_spec.rb
aigu-0.4.4 spec/aigu/core_exporter_spec.rb
aigu-0.4.3 spec/aigu/core_exporter_spec.rb
aigu-0.4.2 spec/aigu/core_exporter_spec.rb
aigu-0.4.1 spec/aigu/core_exporter_spec.rb
aigu-0.4 spec/aigu/core_exporter_spec.rb