-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontamination_spec.rb
More file actions
34 lines (27 loc) · 840 Bytes
/
Copy pathcontamination_spec.rb
File metadata and controls
34 lines (27 loc) · 840 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
require "./contamination"
RSpec.describe "Kata" do
describe ".contamination" do
context "when text or character are empty" do
it "'abc', '' => ''" do
expect(Kata.contamination("abc", "")).to eq("")
end
it "'', 'z' => ''" do
expect(Kata.contamination("", "z")).to eq("")
end
it "'', '' => ''" do
expect(Kata.contamination("", "")).to eq("")
end
end
context "when text and character are present" do
it "'abc', 'z' => 'zzz'" do
expect(Kata.contamination("abc", "z")).to eq("zzz")
end
it "'_3ebzgh4', '&' => '&&&&&&&&'" do
expect(Kata.contamination("_3ebzgh4", "&")).to eq("&&&&&&&&")
end
it "'//case', ' ' => ' '" do
expect(Kata.contamination("//case", " ")).to eq(" ")
end
end
end
end