forked from entp/ruby-openid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_extras.rb
35 lines (31 loc) · 879 Bytes
/
test_extras.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
require "test_helper"
require 'openid/extras'
class StartsWithTestCase < Test::Unit::TestCase
def test_starts_with
[["anything", ""],
["something else", ""],
["", ""],
["foos", "foo"],
].each{|str,target| assert(str.starts_with?(target))}
end
def test_not_starts_with
[["x", "y"],
["foos", "ball"],
["xx", "xy"],
].each{|str,target| assert(!(str.starts_with? target)) }
end
def test_ends_with
[["anything", ""],
["something else", " else"],
["", ""],
["foos", "oos"],
].each{|str,target| assert(str.ends_with?(target))}
end
def test_not_ends_with
[["x", "y"],
["foos", "ball"],
["xx", "xy"],
["foosball", "foosbal"],
].each{|str,target| assert(!(str.ends_with? target)) }
end
end