Sha256: c9c5580212d6065a59d4bd3a24a15d2f4cbbeaeebac3a536e0a3fe2ad6d1ac22

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

require 'helper'

module Blundersaur
  module Keyboards
    class TestQwerty < Test::Unit::TestCase
      def test_keys_near
        expected = {
          "q" => ["w"],
          "w" => ["q", "e"],
          "e" => ["w", "r"],
          "r" => ["e", "t"],
          "t" => ["r", "y"],
          "y" => ["t", "u"],
          "u" => ["y", "i"],
          "i" => ["u", "o"],
          "o" => ["i", "p"],
          "p" => ["o"],
          "a" => ["s"],
          "s" => ["a", "d"],
          "d" => ["s", "f"],
          "f" => ["d", "g"],
          "g" => ["f", "h"],
          "h" => ["g", "j"],
          "j" => ["h", "k"],
          "k" => ["j", "l"],
          "l" => ["k"],
          "z" => ["x"],
          "x" => ["z", "c"],
          "c" => ["x", "v"],
          "v" => ["c", "b"],
          "b" => ["v", "n"],
          "n" => ["b", "m"],
          "m" => ["n"]
        }
        expected.each_pair do |char, set|
          assert_equal set, Qwerty.keys_near(char)
          assert_equal set.collect(&:upcase), Qwerty.keys_near(char.upcase)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blundersaur-0.0.1 test/blundersaur/keyboards/test_qwerty.rb