litmus_paper 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,7 @@ module LitmusPaper
|
|
26
26
|
def _make_request
|
27
27
|
uri = URI.parse(@uri)
|
28
28
|
request = Net::HTTP.const_get(@method.capitalize).new(uri.normalize.path)
|
29
|
+
request.initialize_http_header({"User-Agent" => "Litmus Paper/#{LitmusPaper::VERSION}"})
|
29
30
|
request.set_form_data({})
|
30
31
|
request.basic_auth(uri.user, uri.password) if uri.user || uri.password
|
31
32
|
|
data/lib/litmus_paper/version.rb
CHANGED
@@ -12,7 +12,7 @@ describe LitmusPaper::Dependency::HTTP do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe "#available?" do
|
15
|
-
context "http
|
15
|
+
context "http" do
|
16
16
|
it "uses the given http method when making the request" do
|
17
17
|
check = LitmusPaper::Dependency::HTTP.new("#{@url}/method", :method => "GET", :content => "POST")
|
18
18
|
check.should_not be_available
|
@@ -20,6 +20,11 @@ describe LitmusPaper::Dependency::HTTP do
|
|
20
20
|
check = LitmusPaper::Dependency::HTTP.new("#{@url}/method", :method => "POST", :content => "POST")
|
21
21
|
check.should be_available
|
22
22
|
end
|
23
|
+
|
24
|
+
it "sends a user agent including the version number" do
|
25
|
+
check = LitmusPaper::Dependency::HTTP.new("#{@url}/fail_if_no_agent", :method => "GET", :content => "OK")
|
26
|
+
check.should be_available
|
27
|
+
end
|
23
28
|
end
|
24
29
|
|
25
30
|
context "https" do
|
@@ -9,6 +9,14 @@ class HttpTestServer < Sinatra::Base
|
|
9
9
|
text 200, "POST"
|
10
10
|
end
|
11
11
|
|
12
|
+
get "/fail_if_no_agent" do
|
13
|
+
if request.user_agent.nil?
|
14
|
+
text 400, "No user agent"
|
15
|
+
else
|
16
|
+
text 200, "OK"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
12
20
|
get "/status/:response_status" do
|
13
21
|
if params[:response_status] =~ /\A\d+\z/
|
14
22
|
status = params[:response_status]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: litmus_paper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 5
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 3
|
10
|
+
version: 0.7.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Braintreeps
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-01-24 00:00:00 -06:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: sinatra
|
@@ -209,6 +210,7 @@ files:
|
|
209
210
|
- spec/support/stub_facter.rb
|
210
211
|
- spec/support/test.config
|
211
212
|
- spec/support/test.d.config
|
213
|
+
has_rdoc: true
|
212
214
|
homepage: https://github.com/braintree/litmus_paper
|
213
215
|
licenses: []
|
214
216
|
|
@@ -238,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
240
|
requirements: []
|
239
241
|
|
240
242
|
rubyforge_project:
|
241
|
-
rubygems_version: 1.
|
243
|
+
rubygems_version: 1.3.7
|
242
244
|
signing_key:
|
243
245
|
specification_version: 3
|
244
246
|
summary: Backend health tester for HA Services, partner project of big_brother
|