myflickr 0.0.2

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.
@@ -0,0 +1,11 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe MachineTag, "class" do
4
+ it "should return self from a machine_tag string" do
5
+ tag = MachineTag.from_s("namespace:predicate=value")
6
+ tag.should be_an_instance_of(MachineTag)
7
+ tag.namespace.should eql "namespace"
8
+ tag.predicate.should eql "predicate"
9
+ tag.value.should eql "value"
10
+ end
11
+ end
@@ -0,0 +1,47 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe Photo, "class" do
4
+ it "should have id" do
5
+ Photo.public_instance_methods.should include "id"
6
+ end
7
+
8
+ it "should have a title" do
9
+ Photo.public_instance_methods.should include "title"
10
+ end
11
+
12
+ it "should have a description" do
13
+ Photo.public_instance_methods.should include "description"
14
+ end
15
+
16
+ it "should have sizes" do
17
+ Photo.public_instance_methods.should include "sizes"
18
+ end
19
+
20
+ it "should have tags" do
21
+ Photo.public_instance_methods.should include "tags"
22
+ end
23
+
24
+ it "should have machine_tags" do
25
+ Photo.public_instance_methods.should include "machine_tags"
26
+ end
27
+
28
+ it "should have an array of hashes that contain Size class instances" do
29
+ sizes = Photo.search("spec").first.sizes
30
+ sizes.should be_an_instance_of(Hash)
31
+ sizes[:thumbnail].should be_an_instance_of(Size)
32
+ end
33
+ end
34
+
35
+ describe "Searching" do
36
+ it "should be empty when no search is met" do
37
+ search = Photo.search("null")
38
+ search.should be_an_instance_of(Array)
39
+ search.should be_empty
40
+ end
41
+
42
+ it "should return an array of its self" do
43
+ search = Photo.search("spec")
44
+ search.should be_an_instance_of(Array)
45
+ search.first.should be_an_instance_of(Photo)
46
+ end
47
+ end
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe Query, "class" do
4
+ it "should return a Hpricot Document object response" do
5
+ Query.api_call('flickr.test.echo').should be_an_instance_of Hpricot::Doc
6
+ end
7
+ end
data/spec/set_spec.rb ADDED
@@ -0,0 +1,40 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+ describe Set, "class" do
3
+ it "should respond to id" do
4
+ Set.public_instance_methods.should include "id"
5
+ end
6
+
7
+ it "should respond to title" do
8
+ Set.public_instance_methods.should include "title"
9
+ end
10
+
11
+ it "should respond to description" do
12
+ Set.public_instance_methods.should include "description"
13
+ end
14
+
15
+ it "should keep record of the amount of photos in a set" do
16
+ Set.public_instance_methods.should include "photo_count"
17
+ end
18
+
19
+ it "should respond to photos" do
20
+ Set.public_instance_methods.should include 'photos'
21
+ end
22
+
23
+ it "should provide a list" do
24
+ mysets = Set.list
25
+ mysets.should be_an_instance_of(Array)
26
+ mysets.first.should be_an_instance_of(Set)
27
+ end
28
+
29
+ it "should be findable by id" do
30
+ myset = Set.find "72157603414539843"
31
+ myset.should be_an_instance_of(Set)
32
+ end
33
+
34
+ it "should have a list of photos" do
35
+ myset = Set.find "72157603414539843"
36
+ photos = myset.photos
37
+ photos.should be_an_instance_of(Array)
38
+ photos.first.should be_an_instance_of(Photo)
39
+ end
40
+ end
data/spec/size_spec.rb ADDED
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe Size do
4
+ it "should respond to width, height, source, url" do
5
+ Myflickr::Size.respond_to('width', 'height', 'source', 'url')
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ # All specs will always be run by my user that will have test data
2
+ require File.join(File.dirname(__FILE__), "/../lib/myflickr")
3
+ include Myflickr
4
+ Myflickr::API_KEY = '2b60171843b346aa104e3a38d0129e5e'
5
+ Myflickr::USER_ID = '36821533@N00'
data/spec/tag_spec.rb ADDED
@@ -0,0 +1,13 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe Tag, "class" do
4
+ it "should have a value" do
5
+ Tag.public_instance_methods.should include 'value'
6
+ end
7
+
8
+ it "should have a list" do
9
+ tags = Tag.list
10
+ tags.should be_an_instance_of(Array)
11
+ tags.first.should be_an_instance_of(Tag)
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: myflickr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ""
6
+ authors:
7
+ - Ben Schwarz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2007-12-19 00:00:00 +11:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ description: A wrapper around flickr for you, not the community aspects of flickr, only for you.
25
+ email: ben@germanforblack.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - History.txt
32
+ - License.txt
33
+ - Manifest.txt
34
+ - README.txt
35
+ files:
36
+ - History.txt
37
+ - License.txt
38
+ - Manifest.txt
39
+ - README.txt
40
+ - Rakefile
41
+ - config/hoe.rb
42
+ - config/requirements.rb
43
+ - lib/myflickr.rb
44
+ - lib/myflickr/machine_tag.rb
45
+ - lib/myflickr/photo.rb
46
+ - lib/myflickr/query.rb
47
+ - lib/myflickr/set.rb
48
+ - lib/myflickr/size.rb
49
+ - lib/myflickr/tag.rb
50
+ - lib/myflickr/version.rb
51
+ - lib/vendor/parallel/parallel.rb
52
+ - setup.rb
53
+ - spec/machine_tag_spec.rb
54
+ - spec/photo_spec.rb
55
+ - spec/query_spec.rb
56
+ - spec/set_spec.rb
57
+ - spec/size_spec.rb
58
+ - spec/spec_helper.rb
59
+ - spec/tag_spec.rb
60
+ has_rdoc: true
61
+ homepage: http://schwarz.rubyforge.org
62
+ post_install_message:
63
+ rdoc_options:
64
+ - --main
65
+ - README.txt
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ version:
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ version:
80
+ requirements: []
81
+
82
+ rubyforge_project: schwarz
83
+ rubygems_version: 0.9.5
84
+ signing_key:
85
+ specification_version: 2
86
+ summary: A wrapper around flickr for you, not the community aspects of flickr, only for you.
87
+ test_files: []
88
+