Sha256: 04563bf6c02fccea90c008cc8fb703413e77c83a52da9cc08450dfb2ab18350f

Contents?: true

Size: 838 Bytes

Versions: 31

Compression:

Stored size: 838 Bytes

Contents

# frozen_string_literal: true

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

31 entries across 31 versions & 1 rubygems

Version Path
vedeu-0.8.32 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.31 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.30 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.29 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.28 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.27 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.26 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.25 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.24 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.23 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.22 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.21 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.20 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.19 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.18 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.17 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.16 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.15 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.14 test/lib/vedeu/input/translator_test.rb
vedeu-0.8.13 test/lib/vedeu/input/translator_test.rb