sitehub 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eab93145788748ecc28ef5f14aea92b7595f846
4
- data.tar.gz: 69f240e1d1d707424bf2e6a07e4791b767441427
3
+ metadata.gz: af77a45a381dc3d5db1d15d6d4934dd97fcfcf14
4
+ data.tar.gz: 365f724e5ecc280935665cadc36dbab16b45fe34
5
5
  SHA512:
6
- metadata.gz: a4d317b035c62e2513261872065ef428ae0342fc8a40c5807b8b597908d53b9f288b6aa310cda0ece34b57e6d1d77068040af6ce27c96fc5e22aaf762e0a1f24
7
- data.tar.gz: 4fbf75725640bbc3dcf06e742bb7b549c444048fb8e4f00d0a64888198d62acd1d0b541a4f225b91928107da2e2bc8b70104144ff8697c8035d03c01aef1a266
6
+ metadata.gz: 5a263ad7fde6a5f68b9c3480ae0765b302918cdbd1eccd30bff05704ed9054c171b7c291932bbc5632b32b30162237c5c586e84e9616392a4604e35cff944e74
7
+ data.tar.gz: 48358f5f31aae39ff3d70a3bc83e2760b53b37b46046c2cd28eddf53537aa3b607bcc22dce3143a7ac41acc387898660b55d87e51c99196532be4a38412df0f6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sitehub (0.4.1)
4
+ sitehub (0.4.2)
5
5
  em-http-request
6
6
  em-synchrony
7
7
  faraday
@@ -52,7 +52,7 @@ class SiteHub
52
52
  env[REQUEST_METHOD],
53
53
  env[PATH_INFO],
54
54
  env[QUERY_STRING].empty? ? EMPTY_STRING : QUESTION_MARK+env[QUERY_STRING],
55
- mapped_request.mapped_url.to_s,
55
+ mapped_request ? mapped_request.mapped_url.to_s : EMPTY_STRING,
56
56
  env[HTTP_VERSION],
57
57
  status.to_s[STATUS_RANGE],
58
58
  length,
@@ -1,3 +1,3 @@
1
1
  class SiteHub
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -33,22 +33,14 @@ class SiteHub
33
33
  end
34
34
  end
35
35
 
36
- #describe '#before_call' do
37
- # it 'saves the time' do
38
- # now = Time.now
39
- # allow(Time).to receive(:now).and_return(now)
40
- # subject.before_call(:env)
41
- # expect(subject.start_time).to eq(now)
42
- # end
43
- #end
44
-
45
36
  describe '#call' do
46
37
  let(:env) do
47
38
  {
48
39
  REQUEST_MAPPING => request_mapping,
49
40
  described_class::QUERY_STRING => '',
50
41
  described_class::PATH_INFO => 'path_info',
51
- Constants::RackHttpHeaderKeys::TRANSACTION_ID => :transaction_id
42
+ Constants::RackHttpHeaderKeys::TRANSACTION_ID => :transaction_id,
43
+ described_class::HTTP_VERSION => '1.1'
52
44
  }
53
45
 
54
46
  end
@@ -100,6 +92,14 @@ class SiteHub
100
92
  expect(logger.string).to include("#{env[described_class::PATH_INFO]} => #{:mapped_url}")
101
93
  end
102
94
 
95
+ context '404 returned, i.e. no downstream call made' do
96
+ let(:request_mapping) { nil }
97
+ it 'does not log the down stream url' do
98
+ subject.call(env)
99
+ expect(logger.string).to include("=> #{EMPTY_STRING} #{env[described_class::HTTP_VERSION]}")
100
+ end
101
+ end
102
+
103
103
  end
104
104
  describe '#extract_content_length' do
105
105
  context 'content length header not present' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitehub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ladtech
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack