myflickr 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ module Myflickr
21
21
 
22
22
  # Set tags for photo
23
23
  photo.tags = (photo_call/:tag).map{|tag| Tag.new tag.inner_text}
24
- photo.machine_tags = (photo_call/:tag).map{|tag| MachineTag.new tag.inner_text }
24
+ photo.machine_tags = (photo_call/"tag[@machine_tag=1]").map{|tag| MachineTag.from_s tag.inner_text }
25
25
 
26
26
  return photo
27
27
  end
@@ -2,7 +2,7 @@ module Myflickr
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/spec/photo_spec.rb CHANGED
@@ -19,10 +19,19 @@ describe Photo, "class" do
19
19
 
20
20
  it "should have tags" do
21
21
  Photo.public_instance_methods.should include "tags"
22
+ tags = Photo.find("252091410").tags
23
+ tags.should be_an_instance_of(Array)
24
+ tags.first.should be_an_instance_of(Tag)
22
25
  end
23
26
 
24
27
  it "should have machine_tags" do
25
28
  Photo.public_instance_methods.should include "machine_tags"
29
+ machine_tags = Photo.find("252091410").machine_tags
30
+ machine_tags.should be_an_instance_of(Array)
31
+ machine_tags.first.should be_an_instance_of(MachineTag)
32
+ machine_tags.first.namespace.should eql "flickrfolio"
33
+ machine_tags.first.predicate.should eql "test"
34
+ machine_tags.first.value.should eql "spec"
26
35
  end
27
36
 
28
37
  it "should have an array of hashes that contain Size class instances" do
@@ -44,4 +53,9 @@ describe "Searching" do
44
53
  search.should be_an_instance_of(Array)
45
54
  search.first.should be_an_instance_of(Photo)
46
55
  end
56
+
57
+ it "should find a photo by id" do
58
+ photo = Photo.find "252091410"
59
+ photo.should be_an_instance_of(Photo)
60
+ end
47
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myflickr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ""
6
6
  authors:
7
7
  - Ben Schwarz