require 'spec_helper' describe Aigu::EmberPodExporter do describe :build_output do let(:input_directory) { File.join(File.dirname(__FILE__), '..', 'fixtures', 'ember_pod_files') } let(:exporter) { Aigu::EmberPodExporter.new(:'input-directory' => input_directory, locale: 'en') } let(:output) { exporter.send(:build_output) } let(:expected_output) do { 'app/locales/__LOCALE__/translations.general.json|hello' => 'Hello from general.hello', 'app/pods/component-a/nested-component-a/translations.__LOCALE__.json|errors.general' => 'Nested A) An error occured.', 'app/pods/component-a/nested-component-a/translations.__LOCALE__.json|errors.network' => 'Nested A) A network error occured.', 'app/pods/component-a/nested-component-a/translations.__LOCALE__.json|labels.first_name' => 'Nested A) First Name', 'app/pods/component-a/nested-component-a/translations.__LOCALE__.json|labels.last_name' => 'Nested A) Last Name', 'app/pods/component-a/translations.__LOCALE__.json|errors.general' => 'A) An error occured.', 'app/pods/component-a/translations.__LOCALE__.json|errors.network' => 'A) A network error occured.', 'app/pods/component-a/translations.__LOCALE__.json|labels.first_name' => 'A) First Name', 'app/pods/component-a/translations.__LOCALE__.json|labels.last_name' => 'A) Last Name', 'app/pods/component-b/translations.__LOCALE__.json|errors.general' => 'B) An error occured.', 'app/pods/component-b/translations.__LOCALE__.json|errors.network' => 'B) A network error occured.', 'app/pods/component-b/translations.__LOCALE__.json|labels.first_name' => 'B) First Name', 'app/pods/component-b/translations.__LOCALE__.json|labels.last_name' => 'B) Last Name' } end it { expect(output).to eql expected_output } end end