Sha256: d9cacb69d897380548b49154d805358f0c0afae21883bc9dfd4951220ac8b6bc

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe Aigu::AndroidExporter do
  describe :parse_xml do
    let(:exporter) { Aigu::AndroidExporter.new }
    let(:parse_xml) { exporter.send(:parse_xml, content) }

    let(:content) do
      <<-EOS.unindent
      <?xml version="1.0" encoding="utf-8"?>
      <resources>
        <string name="string1">value1</string>
        <string name="string2">value2</string>
        <string name="string3">value3 with special characters: &amp; &lt; &gt; &apos; &quot;</string>

        <string-array name="pairing_step_three_custom_nickname_array">
            <item>Custom</item>
            <item>Living Room</item>
            <item>Kitchen</item>
            <item>Bedroom</item>
        </string-array>
      </resources>
      EOS
    end

    let(:expected_content) do
      {
        'string1' => 'value1',
        'string2' => 'value2',
        'string3' => 'value3 with special characters: & < > \' "',
        'pairing_step_three_custom_nickname_array__ARRAY_ITEM__#0' => 'Custom',
        'pairing_step_three_custom_nickname_array__ARRAY_ITEM__#1' => 'Living Room',
        'pairing_step_three_custom_nickname_array__ARRAY_ITEM__#2' => 'Kitchen',
        'pairing_step_three_custom_nickname_array__ARRAY_ITEM__#3' => 'Bedroom'
      }
    end

    it { expect(parse_xml).to eql expected_content }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aigu-0.4.3 spec/aigu/android_exporter_spec.rb
aigu-0.4.2 spec/aigu/android_exporter_spec.rb
aigu-0.4.1 spec/aigu/android_exporter_spec.rb
aigu-0.4 spec/aigu/android_exporter_spec.rb