kisaweb 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/History.md +6 -3
- data/VERSION +1 -1
- data/kisaweb.gemspec +1 -1
- data/lib/kisaweb/club.rb +11 -0
- data/spec/club_spec.rb +24 -6
- metadata +1 -1
data/.gitignore
CHANGED
data/History.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
== 0.0.
|
1
|
+
== 0.0.6 / 2009-10-01
|
2
|
+
* Added Club#attributes
|
3
|
+
|
4
|
+
== 0.0.5 / 2009-10-01
|
2
5
|
* Convert all the latin1 shit from Kisaweb to utf8
|
3
6
|
|
4
|
-
== 0.0.4 / 2009-
|
5
|
-
* Added
|
7
|
+
== 0.0.4 / 2009-10-01
|
8
|
+
* Added Contest#attributes
|
6
9
|
|
7
10
|
== 0.0.3 / 2009-09-30
|
8
11
|
* Made Runner#club use the Club class
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/kisaweb.gemspec
CHANGED
data/lib/kisaweb/club.rb
CHANGED
@@ -24,6 +24,17 @@ module Kisaweb
|
|
24
24
|
club
|
25
25
|
end
|
26
26
|
|
27
|
+
def attributes
|
28
|
+
{
|
29
|
+
:abbreviation => abbreviation,
|
30
|
+
:name => name,
|
31
|
+
:area => area,
|
32
|
+
:url => url,
|
33
|
+
:contact_email => contact_email,
|
34
|
+
:reference_number => reference_number
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
27
38
|
private
|
28
39
|
|
29
40
|
def self.find_all
|
data/spec/club_spec.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
2
|
|
3
3
|
describe Kisaweb::Club do
|
4
|
+
before(:each) do
|
5
|
+
clubs_filename = File.dirname(__FILE__) + "/fixtures/clubs.txt"
|
6
|
+
body = File.read(clubs_filename)
|
7
|
+
resp = mock(:typhoeus_response, :body => body)
|
8
|
+
|
9
|
+
Kisaweb::Club.stub(:fetch_all).
|
10
|
+
and_return(resp)
|
11
|
+
end
|
12
|
+
|
4
13
|
describe "from_csv_array" do
|
5
14
|
before(:each) do
|
6
15
|
@arr = ["AOK", "Akilles OK", "FSO", "http://www.akilles.fi/aok/info.html", "peter.tallberg@foobar.fi", "Peter Tallberg", nil, nil, "110", " "]
|
@@ -34,12 +43,6 @@ describe Kisaweb::Club do
|
|
34
43
|
|
35
44
|
describe "all" do
|
36
45
|
before(:each) do
|
37
|
-
clubs_filename = File.dirname(__FILE__) + "/fixtures/clubs.txt"
|
38
|
-
body = File.read(clubs_filename)
|
39
|
-
resp = mock(:typhoeus_response, :body => body)
|
40
|
-
|
41
|
-
Kisaweb::Club.stub(:fetch_all).
|
42
|
-
and_return(resp)
|
43
46
|
@clubs = Kisaweb::Club.all
|
44
47
|
end
|
45
48
|
|
@@ -69,4 +72,19 @@ describe Kisaweb::Club do
|
|
69
72
|
end
|
70
73
|
end
|
71
74
|
end
|
75
|
+
|
76
|
+
describe "attributes" do
|
77
|
+
before(:each) do
|
78
|
+
@club = Kisaweb::Club.find("TP")
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should return a hash of attributes" do
|
82
|
+
@club.attributes.should == {:abbreviation => "TP",
|
83
|
+
:name => "Tampereen Pyrintö",
|
84
|
+
:area => "Häme",
|
85
|
+
:url => "http://www.tampereenpyrinto.fi/suunnistus",
|
86
|
+
:contact_email => "juha.laakkonen@spectra.fi",
|
87
|
+
:reference_number => "5241"}
|
88
|
+
end
|
89
|
+
end
|
72
90
|
end
|