roda 3.28.0 → 3.29.0

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.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +10 -0
  3. data/README.rdoc +10 -0
  4. data/doc/release_notes/3.29.0.txt +15 -0
  5. data/lib/roda.rb +1 -0
  6. data/lib/roda/plugins/caching.rb +2 -0
  7. data/lib/roda/plugins/common_logger.rb +1 -1
  8. data/lib/roda/plugins/exception_page.rb +7 -1
  9. data/lib/roda/plugins/indifferent_params.rb +2 -0
  10. data/lib/roda/version.rb +1 -1
  11. metadata +4 -214
  12. data/Rakefile +0 -108
  13. data/doc/release_notes/1.0.0.txt +0 -329
  14. data/doc/release_notes/1.1.0.txt +0 -226
  15. data/doc/release_notes/1.2.0.txt +0 -406
  16. data/doc/release_notes/1.3.0.txt +0 -109
  17. data/doc/release_notes/2.0.0.txt +0 -75
  18. data/doc/release_notes/2.1.0.txt +0 -124
  19. data/doc/release_notes/2.10.0.txt +0 -27
  20. data/doc/release_notes/2.11.0.txt +0 -70
  21. data/doc/release_notes/2.12.0.txt +0 -40
  22. data/doc/release_notes/2.13.0.txt +0 -10
  23. data/doc/release_notes/2.14.0.txt +0 -44
  24. data/doc/release_notes/2.15.0.txt +0 -53
  25. data/doc/release_notes/2.16.0.txt +0 -48
  26. data/doc/release_notes/2.17.0.txt +0 -62
  27. data/doc/release_notes/2.18.0.txt +0 -69
  28. data/doc/release_notes/2.19.0.txt +0 -30
  29. data/doc/release_notes/2.2.0.txt +0 -97
  30. data/doc/release_notes/2.20.0.txt +0 -5
  31. data/doc/release_notes/2.21.0.txt +0 -17
  32. data/doc/release_notes/2.22.0.txt +0 -41
  33. data/doc/release_notes/2.23.0.txt +0 -29
  34. data/doc/release_notes/2.24.0.txt +0 -65
  35. data/doc/release_notes/2.25.0.txt +0 -14
  36. data/doc/release_notes/2.26.0.txt +0 -13
  37. data/doc/release_notes/2.27.0.txt +0 -56
  38. data/doc/release_notes/2.28.0.txt +0 -17
  39. data/doc/release_notes/2.29.0.txt +0 -156
  40. data/doc/release_notes/2.3.0.txt +0 -109
  41. data/doc/release_notes/2.4.0.txt +0 -55
  42. data/doc/release_notes/2.5.0.txt +0 -23
  43. data/doc/release_notes/2.5.1.txt +0 -4
  44. data/doc/release_notes/2.6.0.txt +0 -21
  45. data/doc/release_notes/2.7.0.txt +0 -75
  46. data/doc/release_notes/2.8.0.txt +0 -44
  47. data/doc/release_notes/2.9.0.txt +0 -6
  48. data/spec/all.rb +0 -1
  49. data/spec/assets/css/app.scss +0 -1
  50. data/spec/assets/css/no_access.css +0 -1
  51. data/spec/assets/css/raw.css +0 -1
  52. data/spec/assets/js/head/app.js +0 -1
  53. data/spec/composition_spec.rb +0 -31
  54. data/spec/define_roda_method_spec.rb +0 -274
  55. data/spec/env_spec.rb +0 -11
  56. data/spec/freeze_spec.rb +0 -37
  57. data/spec/integration_spec.rb +0 -209
  58. data/spec/matchers_spec.rb +0 -832
  59. data/spec/opts_spec.rb +0 -42
  60. data/spec/plugin/_after_hook_spec.rb +0 -19
  61. data/spec/plugin/all_verbs_spec.rb +0 -29
  62. data/spec/plugin/assets_preloading_spec.rb +0 -98
  63. data/spec/plugin/assets_spec.rb +0 -745
  64. data/spec/plugin/backtracking_array_spec.rb +0 -42
  65. data/spec/plugin/branch_locals_spec.rb +0 -106
  66. data/spec/plugin/caching_spec.rb +0 -337
  67. data/spec/plugin/chunked_spec.rb +0 -201
  68. data/spec/plugin/class_level_routing_spec.rb +0 -164
  69. data/spec/plugin/class_matchers_spec.rb +0 -40
  70. data/spec/plugin/common_logger_spec.rb +0 -85
  71. data/spec/plugin/content_for_spec.rb +0 -162
  72. data/spec/plugin/content_security_policy_spec.rb +0 -175
  73. data/spec/plugin/cookies_spec.rb +0 -51
  74. data/spec/plugin/csrf_spec.rb +0 -111
  75. data/spec/plugin/default_headers_spec.rb +0 -82
  76. data/spec/plugin/default_status_spec.rb +0 -95
  77. data/spec/plugin/delay_build_spec.rb +0 -23
  78. data/spec/plugin/delegate_spec.rb +0 -23
  79. data/spec/plugin/delete_empty_headers_spec.rb +0 -27
  80. data/spec/plugin/direct_call_spec.rb +0 -28
  81. data/spec/plugin/disallow_file_uploads_spec.rb +0 -25
  82. data/spec/plugin/drop_body_spec.rb +0 -24
  83. data/spec/plugin/early_hints_spec.rb +0 -19
  84. data/spec/plugin/empty_root_spec.rb +0 -14
  85. data/spec/plugin/environments_spec.rb +0 -42
  86. data/spec/plugin/error_email_spec.rb +0 -97
  87. data/spec/plugin/error_handler_spec.rb +0 -216
  88. data/spec/plugin/error_mail_spec.rb +0 -93
  89. data/spec/plugin/exception_page_spec.rb +0 -168
  90. data/spec/plugin/flash_spec.rb +0 -121
  91. data/spec/plugin/h_spec.rb +0 -11
  92. data/spec/plugin/halt_spec.rb +0 -119
  93. data/spec/plugin/hash_matcher_spec.rb +0 -27
  94. data/spec/plugin/hash_routes_spec.rb +0 -535
  95. data/spec/plugin/head_spec.rb +0 -52
  96. data/spec/plugin/header_matchers_spec.rb +0 -98
  97. data/spec/plugin/heartbeat_spec.rb +0 -74
  98. data/spec/plugin/hooks_spec.rb +0 -152
  99. data/spec/plugin/indifferent_params_spec.rb +0 -14
  100. data/spec/plugin/json_parser_spec.rb +0 -141
  101. data/spec/plugin/json_spec.rb +0 -83
  102. data/spec/plugin/mail_processor_spec.rb +0 -451
  103. data/spec/plugin/mailer_spec.rb +0 -282
  104. data/spec/plugin/match_affix_spec.rb +0 -43
  105. data/spec/plugin/match_hook_spec.rb +0 -79
  106. data/spec/plugin/middleware_spec.rb +0 -237
  107. data/spec/plugin/middleware_stack_spec.rb +0 -81
  108. data/spec/plugin/module_include_spec.rb +0 -48
  109. data/spec/plugin/multi_route_spec.rb +0 -268
  110. data/spec/plugin/multi_run_spec.rb +0 -87
  111. data/spec/plugin/multi_view_spec.rb +0 -50
  112. data/spec/plugin/multibyte_string_matcher_spec.rb +0 -44
  113. data/spec/plugin/named_templates_spec.rb +0 -96
  114. data/spec/plugin/not_allowed_spec.rb +0 -69
  115. data/spec/plugin/not_found_spec.rb +0 -128
  116. data/spec/plugin/optimized_string_matchers_spec.rb +0 -43
  117. data/spec/plugin/padrino_render_spec.rb +0 -34
  118. data/spec/plugin/param_matchers_spec.rb +0 -69
  119. data/spec/plugin/params_capturing_spec.rb +0 -33
  120. data/spec/plugin/partials_spec.rb +0 -43
  121. data/spec/plugin/pass_spec.rb +0 -29
  122. data/spec/plugin/path_matchers_spec.rb +0 -42
  123. data/spec/plugin/path_rewriter_spec.rb +0 -45
  124. data/spec/plugin/path_spec.rb +0 -222
  125. data/spec/plugin/placeholder_string_matchers_spec.rb +0 -126
  126. data/spec/plugin/precompile_templates_spec.rb +0 -61
  127. data/spec/plugin/public_spec.rb +0 -85
  128. data/spec/plugin/render_each_spec.rb +0 -82
  129. data/spec/plugin/render_locals_spec.rb +0 -114
  130. data/spec/plugin/render_spec.rb +0 -912
  131. data/spec/plugin/request_aref_spec.rb +0 -51
  132. data/spec/plugin/request_headers_spec.rb +0 -39
  133. data/spec/plugin/response_request_spec.rb +0 -43
  134. data/spec/plugin/route_block_args_spec.rb +0 -86
  135. data/spec/plugin/route_csrf_spec.rb +0 -305
  136. data/spec/plugin/run_append_slash_spec.rb +0 -77
  137. data/spec/plugin/run_handler_spec.rb +0 -53
  138. data/spec/plugin/sessions_spec.rb +0 -452
  139. data/spec/plugin/shared_vars_spec.rb +0 -45
  140. data/spec/plugin/sinatra_helpers_spec.rb +0 -537
  141. data/spec/plugin/slash_path_empty_spec.rb +0 -22
  142. data/spec/plugin/static_routing_spec.rb +0 -192
  143. data/spec/plugin/static_spec.rb +0 -30
  144. data/spec/plugin/status_303_spec.rb +0 -28
  145. data/spec/plugin/status_handler_spec.rb +0 -158
  146. data/spec/plugin/streaming_spec.rb +0 -246
  147. data/spec/plugin/strip_path_prefix_spec.rb +0 -24
  148. data/spec/plugin/symbol_matchers_spec.rb +0 -51
  149. data/spec/plugin/symbol_status_spec.rb +0 -25
  150. data/spec/plugin/symbol_views_spec.rb +0 -32
  151. data/spec/plugin/timestamp_public_spec.rb +0 -85
  152. data/spec/plugin/type_routing_spec.rb +0 -348
  153. data/spec/plugin/typecast_params_spec.rb +0 -1370
  154. data/spec/plugin/unescape_path_spec.rb +0 -22
  155. data/spec/plugin/view_options_spec.rb +0 -170
  156. data/spec/plugin_spec.rb +0 -71
  157. data/spec/redirect_spec.rb +0 -41
  158. data/spec/request_spec.rb +0 -97
  159. data/spec/response_spec.rb +0 -199
  160. data/spec/route_spec.rb +0 -39
  161. data/spec/session_middleware_spec.rb +0 -129
  162. data/spec/session_spec.rb +0 -37
  163. data/spec/spec_helper.rb +0 -137
  164. data/spec/version_spec.rb +0 -14
  165. data/spec/views/_test.erb +0 -1
  166. data/spec/views/a.erb +0 -1
  167. data/spec/views/a.rdoc +0 -2
  168. data/spec/views/about.erb +0 -1
  169. data/spec/views/about.str +0 -1
  170. data/spec/views/about/_test.css.gz +0 -0
  171. data/spec/views/about/_test.erb +0 -1
  172. data/spec/views/about/_test.erb.gz +0 -0
  173. data/spec/views/about/comp_test.erb +0 -1
  174. data/spec/views/b.erb +0 -1
  175. data/spec/views/c.erb +0 -1
  176. data/spec/views/comp_layout.erb +0 -1
  177. data/spec/views/comp_test.erb +0 -1
  178. data/spec/views/content-yield.erb +0 -1
  179. data/spec/views/each.str +0 -1
  180. data/spec/views/home.erb +0 -2
  181. data/spec/views/home.str +0 -2
  182. data/spec/views/iv.erb +0 -1
  183. data/spec/views/layout-alternative.erb +0 -2
  184. data/spec/views/layout-yield.erb +0 -3
  185. data/spec/views/layout.erb +0 -2
  186. data/spec/views/layout.str +0 -2
  187. data/spec/views/multiple-layout.erb +0 -1
  188. data/spec/views/multiple.erb +0 -1
@@ -1,50 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- begin
4
- require 'tilt/erb'
5
- rescue LoadError
6
- warn "tilt not installed, skipping multi_view plugin test"
7
- else
8
- describe "multi_view plugin" do
9
- before do
10
- app(:bare) do
11
- plugin :render, :views=>'spec/views', :layout=>'layout-yield'
12
- plugin :multi_view
13
-
14
- route do |r|
15
- r.multi_view(['a', 'b', 'c'])
16
- end
17
- end
18
- end
19
-
20
- it "supports easy rendering of multiple views by name" do
21
- body('/a').gsub(/\s+/, '').must_equal "HeaderaFooter"
22
- body('/b').gsub(/\s+/, '').must_equal "HeaderbFooter"
23
- body('/c').gsub(/\s+/, '').must_equal "HeadercFooter"
24
- status('/d').must_equal 404
25
- status('/a', 'REQUEST_METHOD'=>'POST').must_equal 404
26
- end
27
- end
28
-
29
- describe "multi_view plugin multi_view_compile method " do
30
- before do
31
- app(:bare) do
32
- plugin :render, :views=>'spec/views', :layout=>'layout-yield'
33
- plugin :multi_view
34
- regexp = multi_view_compile(['a', 'b', 'c'])
35
-
36
- route do |r|
37
- r.multi_view(regexp)
38
- end
39
- end
40
- end
41
-
42
- it "supports easy rendering of multiple views by name" do
43
- body('/a').gsub(/\s+/, '').must_equal "HeaderaFooter"
44
- body('/b').gsub(/\s+/, '').must_equal "HeaderbFooter"
45
- body('/c').gsub(/\s+/, '').must_equal "HeadercFooter"
46
- status('/d').must_equal 404
47
- status('/a', 'REQUEST_METHOD'=>'POST').must_equal 404
48
- end
49
- end
50
- end
@@ -1,44 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- describe "multibyte_string_matcher plugin" do
4
- it "uses multibyte safe string matching" do
5
- str = "\xD0\xB8".dup.force_encoding('UTF-8')
6
- app(:unescape_path) do |r|
7
- r.is String do |s|
8
- s
9
- end
10
-
11
- r.is(Integer, /(#{str})/u) do |_, a|
12
- a
13
- end
14
-
15
- r.is(Integer, Integer, str) do
16
- 'm'
17
- end
18
-
19
- r.is(Integer, str, Integer) do
20
- 'n'
21
- end
22
- end
23
-
24
- body('/%D0%B8').must_equal str
25
- body('/1/%D0%B8').must_equal str
26
- status('/1/2/%D0%B8').must_equal 404
27
- status('/1/%D0%B8/2').must_equal 404
28
-
29
- status('/1/%D0%B9').must_equal 404
30
- status('/1/2/%D0%B9').must_equal 404
31
- status('/1/%D0%B9/2').must_equal 404
32
-
33
- @app.plugin :multibyte_string_matcher
34
-
35
- body('/%D0%B8').must_equal str
36
- body('/1/%D0%B8').must_equal str
37
- body('/1/2/%D0%B8').must_equal 'm'
38
- body('/1/%D0%B8/2').must_equal 'n'
39
-
40
- status('/1/%D0%B9').must_equal 404
41
- status('/1/2/%D0%B9').must_equal 404
42
- status('/1/%D0%B9/2').must_equal 404
43
- end
44
- end
@@ -1,96 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- begin
4
- require 'tilt/erb'
5
- rescue LoadError
6
- warn "tilt not installed, skipping named_templates plugin test"
7
- else
8
- describe "named_templates plugin" do
9
- it "adds template method method for naming templates, and have render recognize it" do
10
- app(:bare) do
11
- plugin :named_templates
12
-
13
- template :foo do
14
- @b = 2
15
- "foo<%= @a %><%= @b %>"
16
- end
17
- template :layout, :engine=>:str do
18
- @c = 3
19
- 'bar#{@a}#{@c}-#{yield}-baz'
20
- end
21
-
22
- route do |r|
23
- @a = 1
24
- view(:foo)
25
- end
26
- end
27
-
28
- body.must_equal 'bar13-foo12-baz'
29
- @app = Class.new(@app)
30
- body.must_equal 'bar13-foo12-baz'
31
- end
32
-
33
- it "works when freezing the app" do
34
- app(:bare) do
35
- plugin :named_templates
36
-
37
- template :foo do
38
- @b = 2
39
- "foo<%= @a %><%= @b %>"
40
- end
41
- template :layout, :engine=>:str do
42
- @c = 3
43
- 'bar#{@a}#{@c}-#{yield}-baz'
44
- end
45
-
46
- route do |r|
47
- @a = 1
48
- view(:foo)
49
- end
50
- end
51
-
52
- app.freeze
53
- body.must_equal 'bar13-foo12-baz'
54
-
55
- proc{app.template(:b){"a"}}.must_raise
56
- end
57
-
58
- it "works with the view_options plugin" do
59
- app(:bare) do
60
- plugin :render
61
- plugin :view_options
62
- plugin :named_templates
63
-
64
- template "foo/bar" do
65
- @b = 2
66
- "foobar<%= @a %><%= @b %>"
67
- end
68
- template "foo/layout", :engine=>:str do
69
- @c = 3
70
- 'foo#{@a}#{@c}-#{yield}-baz'
71
- end
72
- template "bar/layout", :engine=>:str do
73
- @c = 3
74
- 'bar#{@a}#{@c}-#{yield}-baz'
75
- end
76
-
77
- route do |r|
78
- r.is 'foo' do
79
- set_view_subdir :foo
80
- @a = 1
81
- view(:bar)
82
- end
83
- r.is 'bar' do
84
- set_view_subdir :bar
85
- @a = 4
86
- @b = 2
87
- view(:inline=>"barfoo<%= @a %><%= @b %>")
88
- end
89
- end
90
- end
91
-
92
- body('/foo').must_equal 'foo13-foobar12-baz'
93
- body('/bar').must_equal 'bar43-barfoo42-baz'
94
- end
95
- end
96
- end
@@ -1,69 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- describe "not_allowed plugin" do
4
- it "skips the current block if pass is called" do
5
- app(:not_allowed) do |r|
6
- r.get '' do
7
- 'a'
8
- end
9
-
10
- r.is "c" do
11
- r.get do
12
- "cg"
13
- end
14
-
15
- r.post do
16
- "cp"
17
- end
18
-
19
- "c"
20
- end
21
-
22
- r.on "q" do
23
- r.is do
24
- r.get do
25
- "q"
26
- end
27
- end
28
- end
29
-
30
- r.get do
31
- r.is 'b' do
32
- 'b'
33
- end
34
- r.is(/(d)/) do |s|
35
- s
36
- end
37
- r.get(/(e)/) do |s|
38
- s
39
- end
40
- end
41
- end
42
-
43
- body.must_equal 'a'
44
- status('REQUEST_METHOD'=>'POST').must_equal 405
45
- header('Allow', 'REQUEST_METHOD'=>'POST').must_equal 'GET'
46
-
47
- body('/b').must_equal 'b'
48
- status('/b', 'REQUEST_METHOD'=>'POST').must_equal 404
49
-
50
- body('/d').must_equal 'd'
51
- status('/d', 'REQUEST_METHOD'=>'POST').must_equal 404
52
-
53
- body('/e').must_equal 'e'
54
- status('/e', 'REQUEST_METHOD'=>'POST').must_equal 404
55
-
56
- body('/q').must_equal 'q'
57
- status('/q', 'REQUEST_METHOD'=>'POST').must_equal 405
58
-
59
- body('/c').must_equal 'cg'
60
- body('/c').must_equal 'cg'
61
- body('/c', 'REQUEST_METHOD'=>'POST').must_equal 'cp'
62
- body('/c', 'REQUEST_METHOD'=>'PATCH').must_equal 'c'
63
- status('/c', 'REQUEST_METHOD'=>'PATCH').must_equal 405
64
- header('Allow', '/c', 'REQUEST_METHOD'=>'PATCH').must_equal 'GET, POST'
65
-
66
- @app.plugin :head
67
- header('Allow', '/c', 'REQUEST_METHOD'=>'PATCH').must_equal 'HEAD, GET, POST'
68
- end
69
- end
@@ -1,128 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- describe "not_found plugin" do
4
- it "executes on no arguments" do
5
- app(:bare) do
6
- plugin :not_found
7
-
8
- not_found do
9
- "not found"
10
- end
11
-
12
- route do |r|
13
- r.on "a" do
14
- "found"
15
- end
16
- end
17
- end
18
-
19
- body.must_equal 'not found'
20
- status.must_equal 404
21
- body("/a").must_equal 'found'
22
- status("/a").must_equal 200
23
- end
24
-
25
- it "allows overriding status inside not_found" do
26
- app(:bare) do
27
- plugin :not_found
28
-
29
- not_found do
30
- response.status = 403
31
- "not found"
32
- end
33
-
34
- route do |r|
35
- end
36
- end
37
-
38
- status.must_equal 403
39
- end
40
-
41
- it "calculates correct Content-Length" do
42
- app(:bare) do
43
- plugin :not_found do
44
- "a"
45
- end
46
-
47
- route{}
48
- end
49
-
50
- header('Content-Length').must_equal "1"
51
- end
52
-
53
- it "clears existing headers" do
54
- app(:bare) do
55
- plugin :not_found do ||
56
- "a"
57
- end
58
-
59
- route do |r|
60
- response['Content-Type'] = 'text/pdf'
61
- response['Foo'] = 'bar'
62
- nil
63
- end
64
- end
65
-
66
- header('Content-Type').must_equal 'text/html'
67
- header('Foo').must_be_nil
68
- end
69
-
70
- it "does not modify behavior if not_found is not called" do
71
- app(:not_found) do |r|
72
- r.on "a" do
73
- "found"
74
- end
75
- end
76
-
77
- body.must_equal ''
78
- body("/a").must_equal 'found'
79
- end
80
-
81
- it "can set not_found via the plugin block" do
82
- app(:bare) do
83
- plugin :not_found do
84
- "not found"
85
- end
86
-
87
- route do |r|
88
- r.on "a" do
89
- "found"
90
- end
91
- end
92
- end
93
-
94
- body.must_equal 'not found'
95
- body("/a").must_equal 'found'
96
- end
97
-
98
- it "does not modify behavior if body is not an array" do
99
- app(:bare) do
100
- plugin :not_found do
101
- "not found"
102
- end
103
-
104
- o = Object.new
105
- def o.each; end
106
- route do |r|
107
- r.halt [404, {}, o]
108
- end
109
- end
110
-
111
- body.must_equal ''
112
- end
113
-
114
- it "does not modify behavior if body is not an empty array" do
115
- app(:bare) do
116
- plugin :not_found do
117
- "not found"
118
- end
119
-
120
- route do |r|
121
- response.status = 404
122
- response.write 'a'
123
- end
124
- end
125
-
126
- body.must_equal 'a'
127
- end
128
- end
@@ -1,43 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- describe "optimized_string_matchers plugin" do
4
- it "should support on_branch and is_exactly match methods" do
5
- app(:optimized_string_matchers) do |r|
6
- r.on_branch "e" do
7
- r.is_exactly "f" do
8
- "ef"
9
- end
10
-
11
- "ee"
12
- end
13
-
14
- r.on_branch "a" do
15
- r.on_branch "b" do
16
- r.is_exactly "c" do
17
- "c"
18
- end
19
-
20
- "b"
21
- end
22
-
23
- "a"
24
- end
25
-
26
- "cc"
27
- end
28
-
29
- body.must_equal 'cc'
30
- body('/a').must_equal 'a'
31
- body('/a/').must_equal 'a'
32
- body('/a/b/').must_equal 'b'
33
- body('/a/b/c').must_equal 'c'
34
- body('/a/b/c/').must_equal 'b'
35
- body('/a/b/c/d').must_equal 'b'
36
- body('/e').must_equal 'ee'
37
- body('/eb').must_equal 'cc'
38
- body('/e/').must_equal 'ee'
39
- body('/e/f').must_equal 'ef'
40
- body('/e/f/').must_equal 'ee'
41
- body('/e/fe').must_equal 'ee'
42
- end
43
- end
@@ -1,34 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- begin
4
- require 'tilt/erb'
5
- rescue LoadError
6
- warn "tilt not installed, skipping padrino_render plugin test"
7
- else
8
- describe "padrino_render plugin" do
9
- before do
10
- app(:bare) do
11
- plugin :padrino_render, :views=>"./spec/views"
12
-
13
- route do |r|
14
-
15
- r.is "render" do
16
- render(:content=>'bar', :layout_opts=>{:locals=>{:title=>"Home"}})
17
- end
18
-
19
- r.is "render/nolayout" do
20
- render("about", :locals=>{:title => "No Layout"}, :layout=>nil)
21
- end
22
- end
23
- end
24
- end
25
-
26
- it "render uses layout by default" do
27
- body("/render").strip.must_equal "<title>Roda: Home</title>\nbar"
28
- end
29
-
30
- it "render doesn't use layout if layout is nil" do
31
- body("/render/nolayout").strip.must_equal "<h1>No Layout</h1>"
32
- end
33
- end
34
- end