sinatra-namespace 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.
- data/lib/sinatra/namespace.rb +0 -1
- data/spec/sinatra/namespace_spec.rb +27 -1
- data/spec/spec_helper.rb +1 -0
- metadata +7 -7
data/lib/sinatra/namespace.rb
CHANGED
@@ -247,4 +247,30 @@ describe Sinatra::Namespace do
|
|
247
247
|
last_response.body.should == 'nicht gefunden'
|
248
248
|
end
|
249
249
|
end
|
250
|
-
|
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
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:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
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-
|
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:
|
29
|
+
hash: 15
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
- 5
|
33
|
-
-
|
34
|
-
version: 0.5.
|
33
|
+
- 2
|
34
|
+
version: 0.5.2
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|