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 CHANGED
@@ -1 +1,3 @@
1
- pkg
1
+ pkg
2
+ .DS_Store
3
+ **/.DS_Store
data/History.md CHANGED
@@ -1,8 +1,11 @@
1
- == 0.0.5 / 2009-09-30
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-09-30
5
- * Added contest#attributes
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.5
1
+ 0.0.6
data/kisaweb.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kisaweb}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jarkko Laine"]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kisaweb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarkko Laine