-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchallenge_spec.rb
More file actions
23 lines (18 loc) · 788 Bytes
/
Copy pathchallenge_spec.rb
File metadata and controls
23 lines (18 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require_relative 'solution'
def caesar_cipher(str, shift)
raise NotImplementedError
end
describe 'caesar_cipher' do
it "'abc' with shift 1 return 'bcd'" do
expect(caesar_cipher('abc', 1)).to eq('bcd')
end
it "'abcdefghijklmnopqrstuvwxyz' shift 1 returns 'bcdefghijklmnopqrstuvwxyza'" do
expect(caesar_cipher('abcdefghijklmnopqrstuvwxyz', 1)).to eq('bcdefghijklmnopqrstuvwxyza')
end
it "'abcdefghijklmnopqrstuvwxyz' with shift 1 return 'hijklmnopqrstuvwxyzabcdefg'" do
expect(caesar_cipher('abcdefghijklmnopqrstuvwxyz', 7)).to eq('hijklmnopqrstuvwxyzabcdefg')
end
it "'abcdefghijklmnopqrstuvwxyz' with shift 1 return 'yzabcdefghijklmnopqrstuvwx'" do
expect(caesar_cipher('abcdefghijklmnopqrstuvwxyz', 50)).to eq('yzabcdefghijklmnopqrstuvwx')
end
end