Sha256: 71deadfcd2484577ab9f0ed8d640855dc2e4408e9154ed6eca142286591cf759

Contents?: true

Size: 744 Bytes

Versions: 8

Compression:

Stored size: 744 Bytes

Contents

require 'test_helper'

module Vedeu

  describe InputTranslator do

    let(:described) { Vedeu::InputTranslator }
    let(:instance)  { described.new(code) }
    let(:code)      {}

    describe '#initialize' do
      it { instance.must_be_instance_of(described) }
      it { instance.instance_variable_get('@code').must_equal(code) }
    end

    describe '.translate' do
      context 'when the code is not recognised' do
        it { described.translate('a').must_equal('a') }
      end

      context 'when the code is recognised' do
        it { described.translate("\e[H").must_equal(:home) }
      end
    end

    describe '#translate' do
      it { instance.must_respond_to(:translate) }
    end

  end # InputTranslator

end # Vedeu

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.6.7 test/lib/vedeu/input/input_translator_test.rb
vedeu-0.6.6 test/lib/vedeu/input/input_translator_test.rb
vedeu-0.6.5 test/lib/vedeu/input/input_translator_test.rb
vedeu-0.6.4 test/lib/vedeu/input/input_translator_test.rb
vedeu-0.6.3 test/lib/vedeu/input/input_translator_test.rb
vedeu-0.6.2 test/lib/vedeu/input/input_translator_test.rb
vedeu-0.6.1 test/lib/vedeu/input/input_translator_test.rb
vedeu-0.6.0 test/lib/vedeu/input/input_translator_test.rb