Sha256: c173a86924cadae4e30ea9ae224037c7619ae9cc53c8679cdda880ceca7af1ae

Contents?: true

Size: 983 Bytes

Versions: 16

Compression:

Stored size: 983 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(Key) }
      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

16 entries across 16 versions & 1 rubygems

Version Path
vedeu-0.4.17 test/lib/vedeu/input/key_test.rb
vedeu-0.4.16 test/lib/vedeu/input/key_test.rb
vedeu-0.4.15 test/lib/vedeu/input/key_test.rb
vedeu-0.4.14 test/lib/vedeu/input/key_test.rb
vedeu-0.4.13 test/lib/vedeu/input/key_test.rb
vedeu-0.4.12 test/lib/vedeu/input/key_test.rb
vedeu-0.4.11 test/lib/vedeu/input/key_test.rb
vedeu-0.4.10 test/lib/vedeu/input/key_test.rb
vedeu-0.4.9 test/lib/vedeu/input/key_test.rb
vedeu-0.4.8 test/lib/vedeu/input/key_test.rb
vedeu-0.4.7 test/lib/vedeu/input/key_test.rb
vedeu-0.4.6 test/lib/vedeu/input/key_test.rb
vedeu-0.4.5 test/lib/vedeu/input/key_test.rb
vedeu-0.4.4 test/lib/vedeu/input/key_test.rb
vedeu-0.4.3 test/lib/vedeu/input/key_test.rb
vedeu-0.4.2 test/lib/vedeu/input/key_test.rb