Sha256: 3229f9cb17ebdfb84e2f73083f6a482be144d007fa5deae8eb507f175fabe181

Contents?: true

Size: 647 Bytes

Versions: 4

Compression:

Stored size: 647 Bytes

Contents

require 'test_helper'

module Mayl
  module Commands
    describe Set do
      before do
        @locales = [stub(to_s: 'ca'), stub(to_s: 'en')]
        @env     = stub locales: @locales, namespace: 'activerecord'
        @command = Set.new @env, 'models.post'
      end

      it 'lets the user enter a value for the key in each of the locales' do
        @command.expects(:gets).twice.returns('Article', 'Post') # User interaction

        @locales.first.expects(:set).with('activerecord.models.post', 'Article')
        @locales.last.expects(:set).with('activerecord.models.post', 'Post')

        @command.execute 
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mayl-0.2.1 test/mayl/commands/set_test.rb
mayl-0.2.0 test/mayl/commands/set_test.rb
mayl-0.1.0 test/mayl/commands/set_test.rb
mayl-0.0.1 test/mayl/commands/set_test.rb