We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa2ae6a commit c6f2da5Copy full SHA for c6f2da5
1 file changed
memory_test.rb
@@ -0,0 +1,35 @@
1
+$:.push File.expand_path("../lib", __FILE__)
2
+require 'webmachine'
3
+
4
+class Constantized < Webmachine::Resource
5
+ HELLO_WORLD = "Hello World".freeze
6
+ ALLOWED_METHODS = [Webmachine::GET_METHOD].freeze
7
+ CONTENT_TYPES_PROVIDED = [[Webmachine::TEXT_HTML, :to_html]].freeze
8
9
+ def allowed_methods
10
+ ALLOWED_METHODS
11
+ end
12
13
+ def content_types_provided
14
+ CONTENT_TYPES_PROVIDED
15
16
17
+ def to_html
18
+ HELLO_WORLD
19
20
+end
21
22
+Webmachine.application.routes do
23
+ add ['constantized'], Constantized
24
25
26
+require 'webmachine/test'
27
+session = Webmachine::Test::Session.new(Webmachine.application)
28
29
+require 'memory_profiler'
30
+report = MemoryProfiler.report do
31
+ session.get('/constantized')
32
33
34
+report.pretty_print
35
0 commit comments