-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Photo class under Media namespace
- Loading branch information
Showing
6 changed files
with
52 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require 'helper' | ||
|
||
describe Twitter::Media::Photo do | ||
|
||
describe "#==" do | ||
it "returns true when objects IDs are the same" do | ||
photo = Twitter::Media::Photo.new(:id => 1, :url => "foo") | ||
other = Twitter::Media::Photo.new(:id => 1, :url => "bar") | ||
(photo == other).should be_true | ||
end | ||
it "returns false when objects IDs are different" do | ||
photo = Twitter::Media::Photo.new(:id => 1) | ||
other = Twitter::Media::Photo.new(:id => 2) | ||
(photo == other).should be_false | ||
end | ||
it "returns false when classes are different" do | ||
photo = Twitter::Media::Photo.new(:id => 1) | ||
other = Twitter::Identity.new(:id => 1) | ||
(photo == other).should be_false | ||
end | ||
end | ||
|
||
describe "#sizes" do | ||
it "returns a hash of Sizes when sizes is set" do | ||
sizes = Twitter::Media::Photo.new(:id => 110102452988157952, :sizes => {:small => {:h => 226, :w => 340, :resize => 'fit'}, :large => {:h => 466, :w => 700, :resize => 'fit'}, :medium => {:h => 399, :w => 600, :resize => 'fit'}, :thumb => {:h => 150, :w => 150, :resize => 'crop'}}).sizes | ||
sizes.should be_a Hash | ||
sizes[:small].should be_a Twitter::Size | ||
end | ||
it "is empty when sizes is not set" do | ||
sizes = Twitter::Media::Photo.new(:id => 110102452988157952).sizes | ||
sizes.should be_empty | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters