Sha256: 7ddad1db4c6786998278e70961883503bae9946ecd5ea241f44108b40845483f

Contents?: true

Size: 989 Bytes

Versions: 53

Compression:

Stored size: 989 Bytes

Contents

require 'test_helper'

module Vedeu

  describe Key do

    let(:described) { Vedeu::Key }
    let(:instance)  { described.new(input) { :output } }
    let(:input)     { 'a' }

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

      context 'when the required block is not given' do
        subject { described.new(input) }

        it { proc { subject }.must_raise(InvalidSyntax) }
      end
    end

    describe '#input' do
      subject { instance.input }

      it 'returns the key defined' do
        subject.must_equal('a')
      end

      it { instance.must_respond_to(:key) }
    end

    describe '#output' do
      subject { instance.output }

      it 'returns the result of calling the proc' do
        subject.must_equal(:output)
      end

      it { instance.must_respond_to(:action) }
      it { instance.must_respond_to(:press) }
    end

  end # Key

end # Vedeu

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
vedeu-0.5.4 test/lib/vedeu/input/key_test.rb
vedeu-0.5.3 test/lib/vedeu/input/key_test.rb
vedeu-0.5.2 test/lib/vedeu/input/key_test.rb
vedeu-0.5.1 test/lib/vedeu/input/key_test.rb
vedeu-0.5.0 test/lib/vedeu/input/key_test.rb
vedeu-0.4.65 test/lib/vedeu/input/key_test.rb
vedeu-0.4.64 test/lib/vedeu/input/key_test.rb
vedeu-0.4.63 test/lib/vedeu/input/key_test.rb
vedeu-0.4.62 test/lib/vedeu/input/key_test.rb
vedeu-0.4.61 test/lib/vedeu/input/key_test.rb
vedeu-0.4.60 test/lib/vedeu/input/key_test.rb
vedeu-0.4.59 test/lib/vedeu/input/key_test.rb
vedeu-0.4.58 test/lib/vedeu/input/key_test.rb
vedeu-0.4.57 test/lib/vedeu/input/key_test.rb
vedeu-0.4.56 test/lib/vedeu/input/key_test.rb
vedeu-0.4.55 test/lib/vedeu/input/key_test.rb
vedeu-0.4.54 test/lib/vedeu/input/key_test.rb
vedeu-0.4.53 test/lib/vedeu/input/key_test.rb
vedeu-0.4.52 test/lib/vedeu/input/key_test.rb
vedeu-0.4.51 test/lib/vedeu/input/key_test.rb