Sha256: 5b4d04bbc33f2a6bd5ddf19f20bef94708129a044ee08799a7e200ca9f254e45

Contents?: true

Size: 853 Bytes

Versions: 14

Compression:

Stored size: 853 Bytes

Contents

require File.join(File.dirname(__FILE__), 'spec_helper')
require File.join(File.dirname(__FILE__), '/../generators/i18n_translation/i18n_translation_command')

describe I18nGenerator::Generator::Commands::Create do
  before do
    (@command = Object.new).extend I18nGenerator::Generator::Commands::Create
    @command.stub!(:locale_name).and_return('ja')
  end

  describe 'each_value' do
    it 'iterates through each value' do
      hash = ActiveSupport::OrderedHash.new
      hash[:parent1] = ActiveSupport::OrderedHash.new
      hash[:parent1][:child1] = 'child one'
      hash[:parent2] = ActiveSupport::OrderedHash.new
      hash[:parent2][:child2] = 'child two'
      hash[:parent2][:child3] = 'child three'
      @command.__send__(:each_value, [], hash) do |parents, value|
        p "#{parents.join('.')} #{value}"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
amatsuda-i18n_generators-0.4.1 spec/i18n_translation_command_spec.rb
amatsuda-i18n_generators-0.5.0 spec/i18n_translation_command_spec.rb
amatsuda-i18n_generators-0.6.0 spec/i18n_translation_command_spec.rb
i18n-generators-1.1.3 spec/i18n_translation_command_spec.rb
i18n-generators-1.1.2 spec/i18n_translation_command_spec.rb
i18n-generators-1.1.1 spec/i18n_translation_command_spec.rb
i18n_generators-1.1.0 spec/i18n_translation_command_spec.rb
i18n_generators-1.0.3 spec/i18n_translation_command_spec.rb
i18n_generators-1.0.2 spec/i18n_translation_command_spec.rb
i18n_generators-1.0.1 spec/i18n_translation_command_spec.rb
i18n_generators-1.0.0 spec/i18n_translation_command_spec.rb
i18n_generators-1.0.0.pre1 spec/i18n_translation_command_spec.rb
i18n_generators-0.8.1 spec/i18n_translation_command_spec.rb
i18n_generators-0.8.0 spec/i18n_translation_command_spec.rb