Sha256: b885e6cfc1ca4938cee645a492f524d597a21b478496af0e9ac09dbf7b6c968a

Contents?: true

Size: 807 Bytes

Versions: 69

Compression:

Stored size: 807 Bytes

Contents

require 'test_helper'

module Vedeu

  module Input

    describe Translator do

      let(:described) { Vedeu::Input::Translator }
      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 # Translator

  end # Input

end # Vedeu

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
vedeu-0.8.0 test/lib/vedeu/input/translator_test.rb
vedeu-0.7.4 test/lib/vedeu/input/translator_test.rb
vedeu-0.7.3 test/lib/vedeu/input/translator_test.rb
vedeu-0.7.2 test/lib/vedeu/input/translator_test.rb
vedeu-0.7.1 test/lib/vedeu/input/translator_test.rb
vedeu-0.7.0 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.71 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.70 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.69 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.68 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.67 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.66 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.65 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.64 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.63 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.62 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.61 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.60 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.59 test/lib/vedeu/input/translator_test.rb
vedeu-0.6.58 test/lib/vedeu/input/translator_test.rb