forked from sonota88/anbt_ccl_util
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanbt_ccl_util_spec.rb
executable file
·65 lines (53 loc) · 2.04 KB
/
anbt_ccl_util_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 "anbt_ccl_util"
describe CCL, "when abbr" do
before(:all) do
puts "テスト開始"
end
before(:each) do
@test = CCL.new()
#puts "-------------------"
end
it "url_parse should be " do
@test.url_parse("http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en").should == "creativecommons.org/licenses/by-nc-sa/2.0/deed.en"
end
it "url2abbr should be " do
@test.url2abbr("http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en").should == "BY-NC-SA 2.0"
end
it "url2abbr should be " do
@test.url2abbr("http://creativecommons.org/licenses/by-nc-sa/2.0/").should == "BY-NC-SA 2.0"
end
it "url2abbr should be " do
@test.url2abbr("http://creativecommons.org/licenses/by-nc-sa/2.0").should == "BY-NC-SA 2.0"
end
it "url2abbr should be " do
@test.url2abbr("http://creativecommons.org/licenses/by/2.1/jp/").should == "BY 2.1 JP"
end
it "url2abbr should be " do
@test.url2abbr("http://creativecommons.org/licenses/sampling/1.0/").should == "Sampling 1.0 (retired)"
end
it "url2abbr should be " do
@test.url2abbr("http://creativecommons.org/licenses/sampling+/1.0/").should == "Sampling+ 1.0"
end
it "url2abbr should be " do
@test.url2abbr("http://creativecommons.org/licenses/nc-sampling+/1.0/").should == "NC-Sampling+ 1.0"
end
it "url2abbr(public domain) should be " do
@test.url2abbr("http://creativecommons.org/licenses/publicdomain/").should == "PD"
end
it "url2abbr(MIT) should be " do
@test.url2abbr("http://creativecommons.org/licenses/MIT/").should == "MIT"
end
it "url2abbr(BSD) should be " do
@test.url2abbr("http://creativecommons.org/licenses/BSD/").should == "BSD"
end
it "url2abbr(GPL 2.0) should be " do
@test.url2abbr("http://creativecommons.org/licenses/GPL/2.0/").should == "GPL 2.0"
end
it "url2abbr(LGPL 2.1) should be " do
@test.url2abbr("http://creativecommons.org/licenses/LGPL/2.1").should == "LGPL 2.1"
end
# 振舞レベルで一度だけ実行される後処理
after(:all) do
puts "\nテスト終了"
end
end