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