ndd-url_checker 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/Guardfile +1 -1
- data/README.md +63 -3
- data/VERSION +1 -1
- data/lib/ndd/url_checker/abstract_url_checker.rb +5 -14
- data/lib/ndd/url_checker/blocking_url_checker.rb +18 -37
- data/lib/ndd/url_checker/forked_url_checker.rb +25 -29
- data/lib/ndd/url_checker/parallel_url_checker.rb +12 -11
- data/lib/ndd/url_checker/reporting_url_checker.html.erb +97 -0
- data/lib/ndd/url_checker/reporting_url_checker.rb +83 -0
- data/lib/ndd/url_checker/status.rb +20 -20
- data/lib/ndd/url_checker/threaded_url_checker.rb +10 -8
- data/ndd-url_checker.gemspec +123 -0
- data/spec/ndd/url_checker/abstract_url_checker_spec.rb +0 -6
- data/spec/ndd/url_checker/reporting_url_checker/multiple_urls.html +111 -0
- data/spec/ndd/url_checker/reporting_url_checker/single_url.html +97 -0
- data/spec/ndd/url_checker/reporting_url_checker_spec.rb +70 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/support/multiple_url_checker_spec.rb +3 -11
- data/spec/support/single_url_checker_spec.rb +0 -36
- metadata +8 -2
@@ -14,12 +14,6 @@ RSpec.shared_examples 'a single URL checker' do
|
|
14
14
|
context 'when the URL is valid' do
|
15
15
|
let!(:stub) { stub_request(:get, 'http://www.valid.mock/').to_return(status: 200) }
|
16
16
|
|
17
|
-
describe '#validate' do
|
18
|
-
it 'returns true' do
|
19
|
-
expect(subject.validate('http://www.valid.mock/')).to be_truthy
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
17
|
describe '#check' do
|
24
18
|
let (:status) { subject.check('http://www.valid.mock/') }
|
25
19
|
|
@@ -46,12 +40,6 @@ RSpec.shared_examples 'a single URL checker' do
|
|
46
40
|
let!(:stub3) { stub_redirect('http://www.redirect3.mock/', 'http://www.redirect4.mock/') }
|
47
41
|
let!(:stub4) { stub_request(:get, 'http://www.redirect4.mock/').to_return(status: 200) }
|
48
42
|
|
49
|
-
describe '#validate' do
|
50
|
-
it 'returns true' do
|
51
|
-
expect(subject.validate('http://www.redirect1.mock/')).to be_truthy
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
43
|
describe '#check' do
|
56
44
|
let (:status) { subject.check('http://www.redirect1.mock/') }
|
57
45
|
|
@@ -81,12 +69,6 @@ RSpec.shared_examples 'a single URL checker' do
|
|
81
69
|
let!(:stub4) { stub_redirect('http://www.redirect4.mock/', 'http://www.redirect5.mock/') }
|
82
70
|
let!(:stub5) { stub_redirect('http://www.redirect5.mock/', 'http://www.redirect6.mock/') }
|
83
71
|
|
84
|
-
describe '#validate' do
|
85
|
-
it 'returns false' do
|
86
|
-
expect(subject.validate('http://www.redirect1.mock/')).to be_falsey
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
72
|
describe '#check' do
|
91
73
|
it 'returns UrlChecker::Direct' do
|
92
74
|
result = subject.check('http://www.redirect1.mock/')
|
@@ -109,12 +91,6 @@ RSpec.shared_examples 'a single URL checker' do
|
|
109
91
|
stub_request(:get, 'http://www.invalid.mock/').to_raise(error)
|
110
92
|
}
|
111
93
|
|
112
|
-
describe '#validate' do
|
113
|
-
it 'returns false' do
|
114
|
-
expect(subject.validate('http://www.invalid.mock/')).to be_falsey
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
94
|
describe '#check' do
|
119
95
|
let (:status) { subject.check('http://www.invalid.mock/') }
|
120
96
|
|
@@ -138,12 +114,6 @@ RSpec.shared_examples 'a single URL checker' do
|
|
138
114
|
context 'when there is a socket error' do
|
139
115
|
let!(:stub) { stub_request(:get, 'http://www.invalid.mock/').to_raise(SocketError) }
|
140
116
|
|
141
|
-
describe '#validate' do
|
142
|
-
it 'returns false' do
|
143
|
-
expect(subject.validate('http://www.invalid.mock/')).to be_falsey
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
117
|
describe '#check' do
|
148
118
|
let (:status) { subject.check('http://www.invalid.mock/') }
|
149
119
|
|
@@ -167,12 +137,6 @@ RSpec.shared_examples 'a single URL checker' do
|
|
167
137
|
context 'when there is an unexpected error' do
|
168
138
|
let!(:stub) { stub_request(:get, 'http://www.error.mock/').to_raise('Some error') }
|
169
139
|
|
170
|
-
describe '#validate' do
|
171
|
-
it 'returns false' do
|
172
|
-
expect(subject.validate('http://www.error.mock/')).to be_falsey
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
140
|
describe '#check' do
|
177
141
|
let (:status) { subject.check('http://www.error.mock/') }
|
178
142
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndd-url_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David DIDIER
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cod
|
@@ -274,12 +274,18 @@ files:
|
|
274
274
|
- lib/ndd/url_checker/blocking_url_checker.rb
|
275
275
|
- lib/ndd/url_checker/forked_url_checker.rb
|
276
276
|
- lib/ndd/url_checker/parallel_url_checker.rb
|
277
|
+
- lib/ndd/url_checker/reporting_url_checker.html.erb
|
278
|
+
- lib/ndd/url_checker/reporting_url_checker.rb
|
277
279
|
- lib/ndd/url_checker/status.rb
|
278
280
|
- lib/ndd/url_checker/threaded_url_checker.rb
|
281
|
+
- ndd-url_checker.gemspec
|
279
282
|
- spec/ndd/url_checker/abstract_url_checker_spec.rb
|
280
283
|
- spec/ndd/url_checker/blocking_url_checker_spec.rb
|
281
284
|
- spec/ndd/url_checker/forked_url_checker_spec.rb
|
282
285
|
- spec/ndd/url_checker/parallel_url_checker_spec.rb
|
286
|
+
- spec/ndd/url_checker/reporting_url_checker/multiple_urls.html
|
287
|
+
- spec/ndd/url_checker/reporting_url_checker/single_url.html
|
288
|
+
- spec/ndd/url_checker/reporting_url_checker_spec.rb
|
283
289
|
- spec/ndd/url_checker/status_spec.rb
|
284
290
|
- spec/ndd/url_checker/threaded_url_checker_spec.rb
|
285
291
|
- spec/spec_helper.rb
|