/PasswordVerifier-Ruby

The PasswordVerifier Kata (in Ruby)

Primary LanguageRuby

Password Verifier Kata

A kata from Roy Osherove.

Instructions

Create a password verifications class called PasswordVerifier.

  1. Add the following verifications to a class function verify that returns true or false.
    1. Password should be at least 8 characters.
    2. Password should have at least one uppercase letter.
    3. Password should have at least one lowercase letter.
    4. Password should have at least one number.
  2. Add feature: password is okay if at least three of the previous conditions is true.
  3. Add feature: password is never okay if item 1.4 is not true.

Hints

Useful command line tools:

  1. rake to run Rubocop and RSpec.
  2. mutant --include lib --use rspec PasswordVerifier to run Mutant.

Source

TDD Kata 3

I've made simplifications:

  1. Return a boolean result from PasswordVerifier.verify rather than raising an exception.
  2. No check for nil password.
  3. Dropped instruction about making tests faster.