forked from shokwave/pathfinder-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_tables.rb
27 lines (25 loc) · 880 Bytes
/
test_tables.rb
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
# testing
require 'test/unit'
require 'lib/tables'
class TestTables < Test::Unit::TestCase
TABLES = [Tables::Save[:good], Tables::Save[:medium],
Tables::Save[:poor], Tables::Bab[:good], Tables::Bab[:medium],
Tables::Bab[:poor], Tables::Feats[:base], Tables::Feats[:fighter],
Tables::Feats[:human]]
def test_correct_data
assert_equal(4, Tables::Save[:good][4])
assert_equal(10, Tables::Bab[:poor][20])
assert_equal(1, Tables::Feats[:base][3])
assert_equal(10, Tables::HitDie[:fighter])
end
def test_consistent_zero_is_nil
TABLES.each_cons(2) do |(first, second)|
assert_equal(first[0], second[0], "problem in #{first} or in #{second}")
end
end
def test_undefined_for_higher_than_twenty
TABLES.each_cons(2) do |(first, second)|
assert_equal(first[21], second[21], "problem in #{first} or in #{second}")
end
end
end