kisaweb 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.md +8 -0
- data/VERSION +1 -1
- data/kisaweb.gemspec +2 -1
- data/lib/kisaweb/club.rb +1 -1
- data/lib/kisaweb/runner.rb +3 -2
- data/spec/club_spec.rb +1 -1
- data/spec/list_item_spec.rb +10 -1
- data/spec/online_ranki_spec.rb +1 -1
- data/spec/runner_spec.rb +9 -1
- metadata +2 -1
data/History.md
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
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.
|
8
|
+
s.version = "0.0.3"
|
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"]
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".gitignore",
|
21
|
+
"History.md",
|
21
22
|
"LICENSE",
|
22
23
|
"README.markdown",
|
23
24
|
"Rakefile",
|
data/lib/kisaweb/club.rb
CHANGED
data/lib/kisaweb/runner.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
module Kisaweb
|
2
2
|
class Runner
|
3
|
-
attr_accessor :first_name, :last_name, :
|
3
|
+
attr_accessor :first_name, :last_name, :club_name, :license_number, :club
|
4
4
|
|
5
5
|
def initialize(*args)
|
6
|
-
self.last_name, self.first_name, self.
|
6
|
+
self.last_name, self.first_name, self.club_name, self.license_number = *args
|
7
|
+
self.club = Club.find(club_name)
|
7
8
|
end
|
8
9
|
end
|
9
10
|
end
|
data/spec/club_spec.rb
CHANGED
data/spec/list_item_spec.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
2
|
|
3
3
|
describe Kisaweb::ListItem do
|
4
|
+
before(:all) 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
|
context "from_array" do
|
5
14
|
before(:each) do
|
6
15
|
@arr = ["189", "Paavola", "Niko",
|
@@ -14,7 +23,7 @@ describe Kisaweb::ListItem do
|
|
14
23
|
it "should create runner with correct details" do
|
15
24
|
@item.runner.first_name.should == "Niko"
|
16
25
|
@item.runner.last_name.should == "Paavola"
|
17
|
-
@item.runner.club.should == "HimU"
|
26
|
+
@item.runner.club.abbreviation.should == "HimU"
|
18
27
|
@item.runner.license_number.should == "1223"
|
19
28
|
end
|
20
29
|
|
data/spec/online_ranki_spec.rb
CHANGED
@@ -17,7 +17,7 @@ describe Kisaweb::OnlineRanki do
|
|
17
17
|
before(:each) do
|
18
18
|
body = "D16 255\nD18 166\nD20 151\nD21 745\nD35 200\nD40 233\nD45 215\nD50 168\nD55 171\nD60 140\nD65 74\nD70 38\nH16 279\nH18 213\nH20 172\nH21 1264\nH35 397\nH40 478\nH45 530\nH50 460\nH55 496\nH60 537\nH65 379\nH70 266\nH75 135\nH80 45\nD75 16\nH85 8\n"
|
19
19
|
resp = stub(:typhoeus_response, :body => body)
|
20
|
-
Kisaweb::OnlineRanki.
|
20
|
+
Kisaweb::OnlineRanki.stub(:fetch_categories).
|
21
21
|
and_return(resp)
|
22
22
|
@cats = Kisaweb::OnlineRanki.categories
|
23
23
|
end
|
data/spec/runner_spec.rb
CHANGED
@@ -3,12 +3,20 @@ require File.dirname(__FILE__) + '/spec_helper'
|
|
3
3
|
describe Kisaweb::Runner do
|
4
4
|
context "new" do
|
5
5
|
before(:each) do
|
6
|
-
|
6
|
+
clubs_filename = File.dirname(__FILE__) + "/fixtures/clubs.txt"
|
7
|
+
body = File.read(clubs_filename)
|
8
|
+
resp = mock(:typhoeus_response, :body => body)
|
9
|
+
|
10
|
+
Kisaweb::Club.stub(:fetch_all).
|
11
|
+
and_return(resp)
|
12
|
+
@runner = Kisaweb::Runner.new("last", "first", "IkNV", "12345")
|
7
13
|
end
|
8
14
|
|
9
15
|
it "should set the attributes correctly" do
|
10
16
|
@runner.first_name.should == "first"
|
11
17
|
@runner.last_name.should == "last"
|
18
|
+
|
19
|
+
@runner.club.name.should == "Ikaalisten Nouseva-Voima"
|
12
20
|
end
|
13
21
|
end
|
14
22
|
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.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jarkko Laine
|
@@ -43,6 +43,7 @@ extra_rdoc_files:
|
|
43
43
|
- README.markdown
|
44
44
|
files:
|
45
45
|
- .gitignore
|
46
|
+
- History.md
|
46
47
|
- LICENSE
|
47
48
|
- README.markdown
|
48
49
|
- Rakefile
|