-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpasswords_test.rb
More file actions
36 lines (29 loc) · 780 Bytes
/
passwords_test.rb
File metadata and controls
36 lines (29 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require './passwords'
require 'minitest/autorun'
require 'mutant/minitest/coverage'
module Advent
module Passwords
class RangedPasswordsTest < Minitest::Test
cover "Advent::Passwords"
def test_valid
assert Password.with_ranged_policy("1-3 a: abcde")
end
def test_invalid
assert_raises InvalidPassword do
Password.with_ranged_policy("1-3 b: cdefg")
end
end
end
class PositionedPasswordsTest < Minitest::Test
cover "Advent::Passwords"
def test_valid
assert Password.with_positioned_policy("1-3 a: abcde")
end
def test_invalide
assert_raises InvalidPassword do
Password.with_positioned_policy("1-3 b: cdefg")
end
end
end
end
end