read_it 0.0.1 → 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.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/read_it/sub.rb +4 -0
- data/lib/read_it/version.rb +1 -1
- data/spec/fixtures/sub_latest.json +1172 -1
- data/spec/read_it/post_spec.rb +0 -1
- data/spec/read_it/sub_spec.rb +9 -1
- metadata +2 -2
data/spec/read_it/post_spec.rb
CHANGED
data/spec/read_it/sub_spec.rb
CHANGED
|
@@ -2,7 +2,8 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
module ReadIt
|
|
4
4
|
describe Sub do
|
|
5
|
-
let(:
|
|
5
|
+
let(:json) { File.read 'spec/fixtures/sub_latest.json' }
|
|
6
|
+
let(:response) { double body: json }
|
|
6
7
|
let(:name) { 'subname' }
|
|
7
8
|
subject(:sub) { described_class.new name }
|
|
8
9
|
describe '#initialize' do
|
|
@@ -18,6 +19,13 @@ module ReadIt
|
|
|
18
19
|
end
|
|
19
20
|
end
|
|
20
21
|
|
|
22
|
+
describe '#recent_images' do
|
|
23
|
+
it 'returns only posts with images' do
|
|
24
|
+
allow(ReadIt.http).to receive(:get).and_return response
|
|
25
|
+
expect(sub.recent_images.all? &:image?).to be_truthy
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
21
29
|
describe '#sample' do
|
|
22
30
|
it 'calls sample on recent' do
|
|
23
31
|
recent = []
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: read_it
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Zaninovich
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-08-
|
|
11
|
+
date: 2014-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|