sinatra-namespace 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
1
  require "monkey-lib"
2
2
  require "sinatra/base"
3
3
  require "sinatra/sugar"
4
- require "sinatra/advanced_routes"
5
4
 
6
5
  module Sinatra
7
6
  module Namespace
@@ -247,4 +247,30 @@ describe Sinatra::Namespace do
247
247
  last_response.body.should == 'nicht gefunden'
248
248
  end
249
249
  end
250
- end
250
+
251
+ describe 'memory' do
252
+ before do
253
+ app.namespace('/foo') { get('/bar') { 'blah' }}
254
+ end
255
+
256
+ def measure
257
+ 100.times { get('/foo/bar') }
258
+ GC.start
259
+ # ObjectSpace.each_object.to_a.size
260
+ sum = 0
261
+ ObjectSpace.each_object { sum += 1 }
262
+ sum
263
+ end
264
+
265
+ it 'should not leak objects' do
266
+ if Monkey::Engine.mri?
267
+ measure
268
+ 2.times do
269
+ first = measure
270
+ second = measure
271
+ second.should <= first + 3
272
+ end
273
+ end
274
+ end
275
+ end
276
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require "sinatra/rspec/shared"
2
2
  require "sinatra/namespace"
3
+ require "monkey/engine"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-namespace
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Konstantin Haase
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-09 00:00:00 +02:00
18
+ date: 2010-07-18 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 11
29
+ hash: 15
30
30
  segments:
31
31
  - 0
32
32
  - 5
33
- - 0
34
- version: 0.5.0
33
+ - 2
34
+ version: 0.5.2
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency