hobbit-contrib 0.5.0 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29d73317a40a33d6fcf69c6ad49150fa70ef72b3
4
- data.tar.gz: 8bf31d0dada2d170f0402aef0552d5beb53f906a
3
+ metadata.gz: 55fab9ef331ed253a8f11ec44ae25fc53da572dd
4
+ data.tar.gz: 089a7b5a8fbbbb5454d48980c982cc89b6a7db82
5
5
  SHA512:
6
- metadata.gz: 1a0cca20cec9f5c7afb3050e76848ffb70d558a763a8715b6cc3039582c6c79dba10b5240fb24e206743b7b3a54f32927b39cd3a493124678fc9d317deb8fbc3
7
- data.tar.gz: 498a8dbd9edca5dd63f45ac8b3e0111f71966af2f26b83ef2844da0430e347e82e402d6067862ba8dfbd0dfb3f42caa7ecf6ba454fd33069a7f2b51b3373667a
6
+ metadata.gz: 72e7ecc6ea472c0003dc5b0ccd7f11c9e7b414d73e914cc283b5aeef0692c4da20b97b887375052142e0c751a813b04ff2f263b52383160d41087632a8d23ea5
7
+ data.tar.gz: 852457cfe4f155c9c81d8750d9d7b7f3a3aa6577b28aece8dd1369cf0243055cd854d28b627ca2575fdb21eb088d735a81d4edc327ddd29dfcbff292cc854b8f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.5.1
2
+
3
+ * Fix broken tests.
4
+
1
5
  # 0.5.0
2
6
 
3
7
  * Refactor `Hobbit::ErrorHandling` according to the recent changes on
@@ -1,5 +1,5 @@
1
1
  module Hobbit
2
2
  module Contrib
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
data/lib/hobbit/filter.rb CHANGED
@@ -32,7 +32,10 @@ module Hobbit
32
32
  catch :halt do
33
33
  filter :before
34
34
  unless @response.status == 302
35
+ # we have to do this because `super` will override @response and @request
36
+ prev_response = @response
35
37
  super
38
+ @response.headers.merge! prev_response.headers
36
39
  filter :after unless @halted
37
40
  end
38
41
  end
data/spec/filter_spec.rb CHANGED
@@ -209,7 +209,7 @@ EOS
209
209
  end
210
210
 
211
211
  get '/' do
212
- halt 401, body: 'Unauthenticated'
212
+ halt 401, 'Unauthenticated'
213
213
  end
214
214
  end
215
215
  end
@@ -217,7 +217,8 @@ EOS
217
217
  it 'wont execute the after filter' do
218
218
  get '/'
219
219
  last_response.status.must_equal 401
220
- last_response.headers.wont_include 'Content-Type'
220
+ last_response.headers.must_include 'Content-Type'
221
+ last_response.headers['Content-Type'].must_equal 'text/plain'
221
222
  last_response.body.must_equal 'Unauthenticated'
222
223
  end
223
224
  end
@@ -240,7 +241,7 @@ EOS
240
241
  it 'wont execute the route' do
241
242
  get '/'
242
243
  last_response.status.must_equal 401
243
- last_response.body.must_be :empty?
244
+ last_response.body.must_equal 'hello world'
244
245
  end
245
246
  end
246
247
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobbit-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Mac Adden