git-trend 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +108 -108
- data/lib/git_trend.rb +2 -0
- data/lib/git_trend/cli.rb +1 -1
- data/lib/git_trend/project.rb +2 -2
- data/lib/git_trend/rendering.rb +5 -5
- data/lib/git_trend/scraper.rb +16 -10
- data/lib/git_trend/version.rb +1 -1
- data/spec/fixtures/trending +1048 -723
- data/spec/fixtures/trending?l=objective-c%2B%2B +998 -708
- data/spec/fixtures/trending?l=ruby +1076 -759
- data/spec/fixtures/trending?l=ruby&since=weekly +1061 -750
- data/spec/fixtures/trending?since= +1048 -723
- data/spec/fixtures/trending?since=daily +1048 -723
- data/spec/fixtures/trending?since=monthly +1070 -754
- data/spec/fixtures/trending?since=weekly +1057 -739
- data/spec/git_trend/cli_spec.rb +212 -193
- data/spec/git_trend/scraper_spec.rb +9 -1
- metadata +2 -2
@@ -16,13 +16,21 @@ RSpec.describe GitTrend::Scraper do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
describe '#get' do
|
19
|
+
before { @scraper = Scraper.new }
|
19
20
|
context 'when a network error occurred' do
|
20
21
|
before do
|
21
|
-
@scraper = Scraper.new
|
22
22
|
stub_request(:get, Scraper::BASE_URL)
|
23
23
|
.to_return(status: 500, body: '[]')
|
24
24
|
end
|
25
25
|
it { expect { @scraper.get }.to raise_error(Exception) }
|
26
26
|
end
|
27
|
+
|
28
|
+
context 'when a scraping error occurred' do
|
29
|
+
before do
|
30
|
+
stub_request(:get, Scraper::BASE_URL)
|
31
|
+
.to_return(status: 200, headers: { content_type: 'text/html' }, body: '')
|
32
|
+
end
|
33
|
+
it { expect { @scraper.get }.to raise_error(ScrapeException) }
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-trend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rochefort
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|