claire_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/claire_client.gemspec +2 -1
- data/lib/claire_client/list.rb +3 -1
- data/spec/claire_client/list_spec.rb +7 -1
- data/spec/fixtures/list_with_one_item.xml +11 -0
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/claire_client.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{claire_client}
|
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 = ["Matheus E. Muller"]
|
@@ -39,6 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
"spec/fixtures/item_direct.xml",
|
40
40
|
"spec/fixtures/item_with_channel.xml",
|
41
41
|
"spec/fixtures/list.xml",
|
42
|
+
"spec/fixtures/list_with_one_item.xml",
|
42
43
|
"spec/spec.opts",
|
43
44
|
"spec/spec_helper.rb"
|
44
45
|
]
|
data/lib/claire_client/list.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
3
3
|
|
4
4
|
describe Claire::Client::List do
|
5
5
|
|
6
|
-
before do
|
6
|
+
before :each do
|
7
7
|
Claire::Client.stub(:get).with('categories').and_return(xml(:item_with_channel))
|
8
8
|
@list = Claire::Client::List.new('categories')
|
9
9
|
end
|
@@ -49,6 +49,12 @@ describe Claire::Client::List do
|
|
49
49
|
|
50
50
|
it "the returned objects should be set as partial" do
|
51
51
|
@list.each { |item| item.should be_partial }
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should work normally even when the list has only one item" do
|
55
|
+
Claire::Client.stub(:get).with('categories').and_return(xml(:list_with_one_item))
|
56
|
+
@list = Claire::Client::List.new('categories')
|
57
|
+
@list.each.size.should be 1
|
52
58
|
end
|
53
59
|
end
|
54
60
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
2
|
+
|
3
|
+
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss" xmlns:atom="http://www.w3.org/2005/Atom">
|
4
|
+
|
5
|
+
<item>
|
6
|
+
<title>test</title>
|
7
|
+
<link>http://localhost:3000/categories/4bb48ef61637fd69c1000005</link>
|
8
|
+
<num_videos>1</num_videos>
|
9
|
+
</item>
|
10
|
+
|
11
|
+
</rss>
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matheus E. Muller
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- spec/fixtures/item_direct.xml
|
92
92
|
- spec/fixtures/item_with_channel.xml
|
93
93
|
- spec/fixtures/list.xml
|
94
|
+
- spec/fixtures/list_with_one_item.xml
|
94
95
|
- spec/spec.opts
|
95
96
|
- spec/spec_helper.rb
|
96
97
|
has_rdoc: true
|