giphy 1.1.1 → 1.2.0
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.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/giphy/client.rb +2 -2
- data/lib/giphy/search.rb +2 -2
- data/lib/giphy/version.rb +1 -1
- data/spec/giphy/client_spec.rb +13 -4
- data/spec/giphy/search_spec.rb +14 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd309051cea1c13dfa8ed22b5a2f200d6d7d8446
|
4
|
+
data.tar.gz: e1425d1073873285c07ea700b8541f343d7dd489
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9e7d244fb4b78e0de931a24a10c3bc0c6dd561eab86e0e999ca240e16b80e09aec3ab3afaa0f7ed5227bdd96aad1daeb126fb2455ecce70d7314ca2ab6d04c3
|
7
|
+
data.tar.gz: 5cd2d7d65f0c17dbae0321ca535dd52fbdefc31feee0ac988e87606314360647a80c2af497e64c0027c90a25c739232a6ce667fea4de7de4a08ab49b1643c0d0
|
data/README.md
CHANGED
data/lib/giphy/client.rb
CHANGED
data/lib/giphy/search.rb
CHANGED
data/lib/giphy/version.rb
CHANGED
data/spec/giphy/client_spec.rb
CHANGED
@@ -74,10 +74,19 @@ describe Giphy::Client do
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
describe "#
|
78
|
-
|
79
|
-
|
80
|
-
|
77
|
+
describe "#random" do
|
78
|
+
context "when no tag is passed to it" do
|
79
|
+
it "does a GET on the 'random' endpoint with no tag" do
|
80
|
+
Giphy::Request.stub(:get).with('/random', {tag: ''}).and_return(api_response)
|
81
|
+
expect(subject.random).to eq response
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context "when a tag is passed to it" do
|
86
|
+
it "does a GET on the 'random' endpoint with a tag" do
|
87
|
+
Giphy::Request.stub(:get).with('/random', {tag: 'american psycho'}).and_return(api_response)
|
88
|
+
expect(subject.random('american psycho')).to eq response
|
89
|
+
end
|
81
90
|
end
|
82
91
|
end
|
83
92
|
|
data/spec/giphy/search_spec.rb
CHANGED
@@ -78,10 +78,20 @@ describe Giphy::Search do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
describe "#random" do
|
81
|
-
|
82
|
-
client
|
83
|
-
|
84
|
-
|
81
|
+
context "when no tag is passed to it" do
|
82
|
+
it "returns a new Gif from the client result" do
|
83
|
+
client.stub(random: client_result)
|
84
|
+
Giphy::RandomGif.stub(:new).with(client_result).and_return(response)
|
85
|
+
expect(subject.random).to eq response
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context "when a tag is passed to it" do
|
90
|
+
it "returns a new Gif from the client result" do
|
91
|
+
client.stub(:random).with('american psycho').and_return(client_result)
|
92
|
+
Giphy::RandomGif.stub(:new).with(client_result).and_return(response)
|
93
|
+
expect(subject.random('american psycho')).to eq response
|
94
|
+
end
|
85
95
|
end
|
86
96
|
end
|
87
97
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: giphy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Sogamoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|