-
Notifications
You must be signed in to change notification settings - Fork 0
/
zlorpian_spec.rb
64 lines (58 loc) · 1.4 KB
/
zlorpian_spec.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require "bundler/inline"
require_relative "zlorpian"
gemfile do
gem 'rspec'
end
RSpec.describe Zlorpian do
context "zlorpinumeral" do
[
[0, "-"],
[1, "|"],
[2, "X"],
[3, "#"],
[4, "|-"],
[5, "||"],
[15, "##"],
[16, "|--"],
[17, "|-|"],
[200, "#-X-"],
[221, "#|#|"],
[237, "#X#|"],
[1001, "##XX|"]
].each do |(input, output)|
it "converts #{input} to #{output}" do
expect(subject.zlorpinumeral(input)).to eq output
end
it "converts #{output} to #{input}" do
expect(subject.from_zloropinumeral(output)).to eq input
end
end
end
context "zlorpanese" do
[
[0, "zlorp"],
[1, "borp"],
[2, "daborp"],
[3, "traborp"],
[4, "borpity"],
[5, "borpityborp"],
[6, "borpitydaborp"],
[7, "borpitytraborp"],
[8, "daborpity"],
[9, "daborpityborp"],
[10, "daborpitydaborp"],
[15, "traborpitytraborp"],
[16, "borpen"],
[17, "borpenborp"],
[21, "borpenborpityborp"],
[200, "traborponkdaborpity"],
[221, "traborponkborpentraborpityborp"],
[237, "traborponkdaborpentraborpityborp"],
[1001, "traborpiffatraborponkdaborpendaborpityborp"],
].each do |(input, output)|
it "converts #{input} to #{output}" do
expect(subject.zlorpanese(input)).to eq output
end
end
end
end