assonnato 0.3 → 0.4
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/lib/assonnato/type/episode.rb +8 -0
- data/lib/assonnato/version.rb +1 -1
- data/spec/episode_spec.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5839ba4848b1c31ccbcfc0bd3851e161552284a7
|
4
|
+
data.tar.gz: 8ba7e088195078311134df1925e7d609e09f4489
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e275a7a8b2c11b96d1ae672c8f6d15d846aed4093455133453f47457caa4fe7558147b47a612da5b01c5bbc6e300d9472a3123338ec53bf76e90f2f8e0918bc9
|
7
|
+
data.tar.gz: e626a45edc0cb9cb7c88618e457444396a2b82da3b64d8f31b9478e0cdce45a43cf52074a61522de688f91361ebb47763ad82e934b7fec8c3b1f87dee7f04983
|
@@ -13,5 +13,13 @@ module Assonnato
|
|
13
13
|
def all!(show)
|
14
14
|
parse get(@host, "/shows/get/#{URI.escape show}/episodes/all")
|
15
15
|
end
|
16
|
+
|
17
|
+
def search!(keyword)
|
18
|
+
raise NotImplementedError, 'you can search only the shows'
|
19
|
+
end
|
20
|
+
|
21
|
+
def get!(show, episode)
|
22
|
+
all!(show).select { |ep| ep.id == episode }
|
23
|
+
end
|
16
24
|
end
|
17
25
|
end
|
data/lib/assonnato/version.rb
CHANGED
data/spec/episode_spec.rb
CHANGED
@@ -13,4 +13,18 @@ describe 'Assonnato' do
|
|
13
13
|
res.first.should be_kind_of(Struct)
|
14
14
|
res.first.episode.should eql(1)
|
15
15
|
end
|
16
|
+
|
17
|
+
it 'can\'t search episodes' do
|
18
|
+
expect {
|
19
|
+
@episode.search!('monogatari')
|
20
|
+
}.to raise_error(NotImplementedError)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'returns a specific episode of the given show' do
|
24
|
+
res = @episode.get! 'Monogatari Second Series', 1
|
25
|
+
res.should be_kind_of(Array)
|
26
|
+
res.should_not be_empty
|
27
|
+
res.first.should be_kind_of(Struct)
|
28
|
+
res.first.episode.should eql(1)
|
29
|
+
end
|
16
30
|
end
|