git-trend 0.1.0 → 0.1.1

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.
@@ -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.0
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-08-14 00:00:00.000000000 Z
11
+ date: 2014-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor