merb-core 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +136 -2
- data/CONTRIBUTORS +6 -0
- data/PUBLIC_CHANGELOG +38 -0
- data/Rakefile +38 -30
- data/lib/merb-core.rb +88 -23
- data/lib/merb-core/bootloader.rb +235 -51
- data/lib/merb-core/config.rb +121 -36
- data/lib/merb-core/controller/abstract_controller.rb +59 -36
- data/lib/merb-core/controller/exceptions.rb +2 -15
- data/lib/merb-core/controller/merb_controller.rb +44 -1
- data/lib/merb-core/controller/mime.rb +4 -0
- data/lib/merb-core/controller/mixins/controller.rb +38 -21
- data/lib/merb-core/controller/mixins/render.rb +44 -29
- data/lib/merb-core/controller/mixins/responder.rb +3 -31
- data/lib/merb-core/controller/template.rb +45 -21
- data/lib/merb-core/core_ext/kernel.rb +60 -32
- data/lib/merb-core/dispatch/default_exception/default_exception.rb +2 -2
- data/lib/merb-core/dispatch/default_exception/views/_css.html.erb +3 -1
- data/lib/merb-core/dispatch/default_exception/views/_javascript.html.erb +71 -67
- data/lib/merb-core/dispatch/default_exception/views/index.html.erb +7 -3
- data/lib/merb-core/dispatch/dispatcher.rb +3 -3
- data/lib/merb-core/dispatch/request.rb +56 -9
- data/lib/merb-core/dispatch/router.rb +159 -133
- data/lib/merb-core/dispatch/router/behavior.rb +462 -703
- data/lib/merb-core/dispatch/router/cached_proc.rb +3 -3
- data/lib/merb-core/dispatch/router/resources.rb +289 -0
- data/lib/merb-core/dispatch/router/route.rb +514 -294
- data/lib/merb-core/dispatch/session.rb +4 -2
- data/lib/merb-core/logger.rb +213 -202
- data/lib/merb-core/plugins.rb +9 -1
- data/lib/merb-core/rack.rb +3 -1
- data/lib/merb-core/rack/adapter.rb +7 -4
- data/lib/merb-core/rack/adapter/abstract.rb +188 -0
- data/lib/merb-core/rack/adapter/ebb.rb +12 -13
- data/lib/merb-core/rack/adapter/evented_mongrel.rb +2 -15
- data/lib/merb-core/rack/adapter/irb.rb +3 -2
- data/lib/merb-core/rack/adapter/mongrel.rb +22 -15
- data/lib/merb-core/rack/adapter/swiftiplied_mongrel.rb +4 -16
- data/lib/merb-core/rack/adapter/thin.rb +21 -22
- data/lib/merb-core/rack/adapter/thin_turbo.rb +4 -11
- data/lib/merb-core/rack/adapter/webrick.rb +54 -18
- data/lib/merb-core/rack/application.rb +4 -4
- data/lib/merb-core/rack/handler/mongrel.rb +12 -13
- data/lib/merb-core/rack/middleware/csrf.rb +1 -1
- data/lib/merb-core/rack/stream_wrapper.rb +41 -0
- data/lib/merb-core/server.rb +157 -90
- data/lib/merb-core/tasks/gem_management.rb +267 -0
- data/lib/merb-core/tasks/merb.rb +1 -0
- data/lib/merb-core/tasks/merb_rake_helper.rb +48 -34
- data/lib/merb-core/tasks/stats.rake +1 -1
- data/lib/merb-core/test.rb +9 -3
- data/lib/merb-core/test/helpers.rb +1 -0
- data/lib/merb-core/test/helpers/mock_request_helper.rb +393 -0
- data/lib/merb-core/test/helpers/multipart_request_helper.rb +3 -2
- data/lib/merb-core/test/helpers/request_helper.rb +40 -372
- data/lib/merb-core/test/helpers/route_helper.rb +16 -2
- data/lib/merb-core/test/matchers.rb +1 -0
- data/lib/merb-core/test/matchers/controller_matchers.rb +4 -247
- data/lib/merb-core/test/matchers/request_matchers.rb +140 -0
- data/lib/merb-core/test/matchers/view_matchers.rb +22 -4
- data/lib/merb-core/test/run_specs.rb +118 -26
- data/lib/merb-core/test/test_ext/rspec.rb +181 -0
- data/lib/merb-core/version.rb +1 -9
- metadata +10 -342
- data/docs/bootloading.dox +0 -58
- data/docs/documentation_standards +0 -40
- data/docs/merb-core-call-stack-diagram.mmap +0 -0
- data/docs/merb-core-call-stack-diagram.pdf +0 -0
- data/docs/merb-core-call-stack-diagram.png +0 -0
- data/docs/new_render_api +0 -51
- data/lib/merb-core/vendor/facets.rb +0 -2
- data/lib/merb-core/vendor/facets/dictionary.rb +0 -433
- data/lib/merb-core/vendor/facets/inflect.rb +0 -342
- data/spec/private/config/adapter_spec.rb +0 -32
- data/spec/private/config/config_spec.rb +0 -202
- data/spec/private/config/environment_spec.rb +0 -13
- data/spec/private/config/merb_spec.rb +0 -34
- data/spec/private/config/spec_helper.rb +0 -1
- data/spec/private/core_ext/kernel_spec.rb +0 -159
- data/spec/private/dispatch/bootloader_spec.rb +0 -24
- data/spec/private/dispatch/fixture/app/controllers/application.rb +0 -4
- data/spec/private/dispatch/fixture/app/controllers/exceptions.rb +0 -25
- data/spec/private/dispatch/fixture/app/controllers/foo.rb +0 -19
- data/spec/private/dispatch/fixture/app/helpers/global_helpers.rb +0 -8
- data/spec/private/dispatch/fixture/app/views/exeptions/client_error.html.erb +0 -37
- data/spec/private/dispatch/fixture/app/views/exeptions/internal_server_error.html.erb +0 -216
- data/spec/private/dispatch/fixture/app/views/exeptions/not_acceptable.html.erb +0 -38
- data/spec/private/dispatch/fixture/app/views/exeptions/not_found.html.erb +0 -40
- data/spec/private/dispatch/fixture/app/views/foo/bar.html.erb +0 -0
- data/spec/private/dispatch/fixture/app/views/layout/application.html.erb +0 -11
- data/spec/private/dispatch/fixture/config/black_hole.rb +0 -12
- data/spec/private/dispatch/fixture/config/environments/development.rb +0 -6
- data/spec/private/dispatch/fixture/config/environments/production.rb +0 -5
- data/spec/private/dispatch/fixture/config/environments/test.rb +0 -6
- data/spec/private/dispatch/fixture/config/init.rb +0 -45
- data/spec/private/dispatch/fixture/config/rack.rb +0 -11
- data/spec/private/dispatch/fixture/config/router.rb +0 -35
- data/spec/private/dispatch/fixture/log/merb_test.log +0 -8839
- data/spec/private/dispatch/fixture/public/images/merb.jpg +0 -0
- data/spec/private/dispatch/fixture/public/merb.fcgi +0 -4
- data/spec/private/dispatch/fixture/public/stylesheets/master.css +0 -119
- data/spec/private/dispatch/route_params_spec.rb +0 -23
- data/spec/private/dispatch/spec_helper.rb +0 -1
- data/spec/private/router/behavior_spec.rb +0 -60
- data/spec/private/router/fixture/log/merb_test.log +0 -35
- data/spec/private/router/route_spec.rb +0 -418
- data/spec/private/router/router_spec.rb +0 -183
- data/spec/private/vendor/facets/plural_spec.rb +0 -564
- data/spec/private/vendor/facets/singular_spec.rb +0 -489
- data/spec/public/DEFINITIONS +0 -11
- data/spec/public/abstract_controller/controllers/alt_views/layout/application.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/layout/merb/test/fixtures/abstract/render_string_controller_layout.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/layout/merb/test/fixtures/abstract/render_template_controller_layout.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/display_object_with_multiple_roots/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/display_object_with_multiple_roots/show.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/render_template_multiple_roots/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/partial/basic_partial_with_multiple_roots/_partial.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_and_custom_location/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_inherited/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/cousins.rb +0 -41
- data/spec/public/abstract_controller/controllers/display.rb +0 -60
- data/spec/public/abstract_controller/controllers/filters.rb +0 -260
- data/spec/public/abstract_controller/controllers/helpers.rb +0 -41
- data/spec/public/abstract_controller/controllers/partial.rb +0 -121
- data/spec/public/abstract_controller/controllers/render.rb +0 -113
- data/spec/public/abstract_controller/controllers/views/helpers/capture/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/helpers/capture_eq/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/helpers/capture_with_args/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/helpers/concat/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/layout/alt.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/layout/custom.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object_with_action/new.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_app_layout/index.erb +0 -0
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_custom_layout/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_multiple_roots/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_multiple_roots/show.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_two_throw_contents/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/another_directory/_partial.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/basic_partial/_partial.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/basic_partial/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/basic_partial_with_multiple_roots/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/nested_partial/_first.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/nested_partial/_second.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/nested_partial/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_in_another_directory/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_both/_collection.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_both/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_collections/_collection.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_collections/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as/_collection.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_counter/_collection.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_counter/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_locals/_variables.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_locals/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals/_both.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_absolute_partial/_partial.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_absolute_partial/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_as_partial/_with_partial.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_as_partial/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_nil_partial/_with_partial.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_nil_partial/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_partial/_with_partial.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/partial/with_partial/index.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/test_display/foo.html.erb +0 -1
- data/spec/public/abstract_controller/controllers/views/test_render/foo.html.erb +0 -0
- data/spec/public/abstract_controller/controllers/views/wonderful/index.erb +0 -1
- data/spec/public/abstract_controller/display_spec.rb +0 -37
- data/spec/public/abstract_controller/filter_spec.rb +0 -136
- data/spec/public/abstract_controller/helper_spec.rb +0 -21
- data/spec/public/abstract_controller/partial_spec.rb +0 -61
- data/spec/public/abstract_controller/render_spec.rb +0 -90
- data/spec/public/abstract_controller/spec_helper.rb +0 -31
- data/spec/public/boot_loader/boot_loader_spec.rb +0 -33
- data/spec/public/boot_loader/spec_helper.rb +0 -1
- data/spec/public/controller/authentication_spec.rb +0 -174
- data/spec/public/controller/base_spec.rb +0 -88
- data/spec/public/controller/conditional_get_spec.rb +0 -100
- data/spec/public/controller/config/init.rb +0 -6
- data/spec/public/controller/controllers/authentication.rb +0 -74
- data/spec/public/controller/controllers/base.rb +0 -65
- data/spec/public/controller/controllers/conditional_get.rb +0 -35
- data/spec/public/controller/controllers/cookies.rb +0 -36
- data/spec/public/controller/controllers/dispatcher.rb +0 -35
- data/spec/public/controller/controllers/display.rb +0 -118
- data/spec/public/controller/controllers/redirect.rb +0 -36
- data/spec/public/controller/controllers/responder.rb +0 -93
- data/spec/public/controller/controllers/url.rb +0 -7
- data/spec/public/controller/controllers/views/layout/custom.html.erb +0 -1
- data/spec/public/controller/controllers/views/layout/custom_arg.html.erb +0 -1
- data/spec/public/controller/controllers/views/layout/custom_arg.json.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_and_local_provides/index.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_and_local_provides/index.xml.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides/index.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides/index.xml.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template/index.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template/no_layout.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template_argument/index.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/html_default/index.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/layout/custom.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/local_provides/index.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/local_provides/index.xml.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides/index.html.erb +0 -1
- data/spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides/index.js.erb +0 -1
- data/spec/public/controller/cookies_spec.rb +0 -95
- data/spec/public/controller/dispatcher_spec.rb +0 -410
- data/spec/public/controller/display_spec.rb +0 -84
- data/spec/public/controller/redirect_spec.rb +0 -33
- data/spec/public/controller/responder_spec.rb +0 -169
- data/spec/public/controller/spec_helper.rb +0 -13
- data/spec/public/controller/url_spec.rb +0 -255
- data/spec/public/core/merb_core_spec.rb +0 -45
- data/spec/public/core_ext/fixtures/core_ext_dependency.rb +0 -2
- data/spec/public/core_ext/kernel_spec.rb +0 -88
- data/spec/public/core_ext/spec_helper.rb +0 -1
- data/spec/public/directory_structure/directory/app/controllers/application.rb +0 -3
- data/spec/public/directory_structure/directory/app/controllers/base.rb +0 -13
- data/spec/public/directory_structure/directory/app/controllers/custom.rb +0 -19
- data/spec/public/directory_structure/directory/app/views/base/template.html.erb +0 -1
- data/spec/public/directory_structure/directory/app/views/wonderful/template.erb +0 -1
- data/spec/public/directory_structure/directory/config/router.rb +0 -3
- data/spec/public/directory_structure/directory/log/merb_test.log +0 -4588
- data/spec/public/directory_structure/directory_spec.rb +0 -43
- data/spec/public/logger/logger_spec.rb +0 -181
- data/spec/public/logger/spec_helper.rb +0 -1
- data/spec/public/rack/conditinal_get_middleware_spec.rb +0 -127
- data/spec/public/rack/csrf_middleware_spec.rb +0 -70
- data/spec/public/rack/rack_middleware_spec.rb +0 -99
- data/spec/public/rack/shared_example_groups.rb +0 -35
- data/spec/public/reloading/directory/app/controllers/application.rb +0 -3
- data/spec/public/reloading/directory/app/controllers/reload.rb +0 -6
- data/spec/public/reloading/directory/config/init.rb +0 -2
- data/spec/public/reloading/directory/log/merb_test.log +0 -288231
- data/spec/public/reloading/reload_spec.rb +0 -103
- data/spec/public/request/multipart_spec.rb +0 -41
- data/spec/public/request/request_spec.rb +0 -250
- data/spec/public/router/default_spec.rb +0 -21
- data/spec/public/router/deferred_spec.rb +0 -22
- data/spec/public/router/fixation_spec.rb +0 -49
- data/spec/public/router/fixture/log/merb_test.log +0 -524
- data/spec/public/router/namespace_spec.rb +0 -113
- data/spec/public/router/nested_matches_spec.rb +0 -97
- data/spec/public/router/nested_resources_spec.rb +0 -41
- data/spec/public/router/resource_spec.rb +0 -37
- data/spec/public/router/resources_spec.rb +0 -82
- data/spec/public/router/spec_helper.rb +0 -90
- data/spec/public/router/special_spec.rb +0 -61
- data/spec/public/router/string_spec.rb +0 -61
- data/spec/public/session/controllers/sessions.rb +0 -56
- data/spec/public/session/cookie_session_spec.rb +0 -73
- data/spec/public/session/memcached_session_spec.rb +0 -31
- data/spec/public/session/memory_session_spec.rb +0 -28
- data/spec/public/session/multiple_sessions_spec.rb +0 -74
- data/spec/public/session/no_session_spec.rb +0 -12
- data/spec/public/session/session_spec.rb +0 -106
- data/spec/public/template/template_spec.rb +0 -104
- data/spec/public/template/templates/error.html.erb +0 -2
- data/spec/public/template/templates/template.html.erb +0 -1
- data/spec/public/template/templates/template.html.myt +0 -1
- data/spec/public/test/controller_matchers_spec.rb +0 -412
- data/spec/public/test/controllers/controller_assertion_mock.rb +0 -7
- data/spec/public/test/controllers/dispatch_controller.rb +0 -11
- data/spec/public/test/controllers/spec_helper_controller.rb +0 -39
- data/spec/public/test/multipart_request_helper_spec.rb +0 -159
- data/spec/public/test/multipart_upload_text_file.txt +0 -1
- data/spec/public/test/request_helper_spec.rb +0 -269
- data/spec/public/test/route_helper_spec.rb +0 -78
- data/spec/public/test/route_matchers_spec.rb +0 -166
- data/spec/public/test/view_helper_spec.rb +0 -96
- data/spec/public/test/view_matchers_spec.rb +0 -183
- data/spec/spec_helper.rb +0 -121
Binary file
|
@@ -1,119 +0,0 @@
|
|
1
|
-
body {
|
2
|
-
font-family: Arial, Verdana, sans-serif;
|
3
|
-
font-size: 12px;
|
4
|
-
background-color: #fff;
|
5
|
-
}
|
6
|
-
* {
|
7
|
-
margin: 0px;
|
8
|
-
padding: 0px;
|
9
|
-
text-decoration: none;
|
10
|
-
}
|
11
|
-
html {
|
12
|
-
height: 100%;
|
13
|
-
margin-bottom: 1px;
|
14
|
-
}
|
15
|
-
#container {
|
16
|
-
width: 80%;
|
17
|
-
text-align: left;
|
18
|
-
background-color: #fff;
|
19
|
-
margin-right: auto;
|
20
|
-
margin-left: auto;
|
21
|
-
}
|
22
|
-
#header-container {
|
23
|
-
width: 100%;
|
24
|
-
padding-top: 15px;
|
25
|
-
}
|
26
|
-
#header-container h1, #header-container h2 {
|
27
|
-
margin-left: 6px;
|
28
|
-
margin-bottom: 6px;
|
29
|
-
}
|
30
|
-
.spacer {
|
31
|
-
width: 100%;
|
32
|
-
height: 15px;
|
33
|
-
}
|
34
|
-
hr {
|
35
|
-
border: 0px;
|
36
|
-
color: #ccc;
|
37
|
-
background-color: #cdcdcd;
|
38
|
-
height: 1px;
|
39
|
-
width: 100%;
|
40
|
-
text-align: left;
|
41
|
-
}
|
42
|
-
h1 {
|
43
|
-
font-size: 28px;
|
44
|
-
color: #c55;
|
45
|
-
background-color: #fff;
|
46
|
-
font-family: Arial, Verdana, sans-serif;
|
47
|
-
font-weight: 300;
|
48
|
-
}
|
49
|
-
h2 {
|
50
|
-
font-size: 15px;
|
51
|
-
color: #999;
|
52
|
-
font-family: Arial, Verdana, sans-serif;
|
53
|
-
font-weight: 300;
|
54
|
-
background-color: #fff;
|
55
|
-
}
|
56
|
-
h3 {
|
57
|
-
color: #4d9b12;
|
58
|
-
font-size: 15px;
|
59
|
-
text-align: left;
|
60
|
-
font-weight: 300;
|
61
|
-
padding: 5px;
|
62
|
-
margin-top: 5px;
|
63
|
-
}
|
64
|
-
|
65
|
-
#left-container {
|
66
|
-
float: left;
|
67
|
-
width: 250px;
|
68
|
-
background-color: #FFFFFF;
|
69
|
-
color: black;
|
70
|
-
}
|
71
|
-
|
72
|
-
#left-container h3 {
|
73
|
-
color: #c55;
|
74
|
-
}
|
75
|
-
|
76
|
-
#main-container {
|
77
|
-
margin: 5px 5px 5px 260px;
|
78
|
-
padding: 15px;
|
79
|
-
border-left: 1px solid silver;
|
80
|
-
min-height: 400px;
|
81
|
-
}
|
82
|
-
p {
|
83
|
-
color: #000;
|
84
|
-
background-color: #fff;
|
85
|
-
line-height: 20px;
|
86
|
-
padding: 5px;
|
87
|
-
}
|
88
|
-
a {
|
89
|
-
color: #4d9b12;
|
90
|
-
background-color: #fff;
|
91
|
-
text-decoration: none;
|
92
|
-
}
|
93
|
-
a:hover {
|
94
|
-
color: #4d9b12;
|
95
|
-
background-color: #fff;
|
96
|
-
text-decoration: underline;
|
97
|
-
}
|
98
|
-
#footer-container {
|
99
|
-
clear: both;
|
100
|
-
font-size: 12px;
|
101
|
-
font-family: Verdana, Arial, sans-serif;
|
102
|
-
}
|
103
|
-
.right {
|
104
|
-
float: right;
|
105
|
-
font-size: 100%;
|
106
|
-
margin-top: 5px;
|
107
|
-
color: #999;
|
108
|
-
background-color: #fff;
|
109
|
-
}
|
110
|
-
.left {
|
111
|
-
float: left;
|
112
|
-
font-size: 100%;
|
113
|
-
margin-top: 5px;
|
114
|
-
color: #999;
|
115
|
-
background-color: #fff;
|
116
|
-
}
|
117
|
-
#main-container ul {
|
118
|
-
margin-left: 3.0em;
|
119
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
$START_OPTIONS = {:merb_root => File.join(File.dirname(__FILE__), "fixture")}
|
2
|
-
require File.join(File.dirname(__FILE__), "spec_helper")
|
3
|
-
require 'rack/mock'
|
4
|
-
require 'stringio'
|
5
|
-
|
6
|
-
describe Merb::Dispatcher, "route params" do
|
7
|
-
before(:each) do
|
8
|
-
env = Rack::MockRequest.env_for("/foo/bar/54")
|
9
|
-
env['REQUEST_URI'] = "/foo/bar/54" # MockRequest doesn't set this
|
10
|
-
@controller = Merb::Dispatcher.handle(Merb::Request.new(env))
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should properly set the route params" do
|
14
|
-
@controller.request.route_params[:id].should == '54'
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should properly add route_params to params" do
|
18
|
-
@controller.request.route_params.each { |k,v|
|
19
|
-
@controller.request.params[k].should == v
|
20
|
-
}
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
|
@@ -1,60 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
require 'ostruct'
|
3
|
-
require 'rack/mock'
|
4
|
-
require 'stringio'
|
5
|
-
Merb.start :environment => 'test',
|
6
|
-
:merb_root => File.dirname(__FILE__) / 'fixture'
|
7
|
-
|
8
|
-
|
9
|
-
class SimpleRequest < OpenStruct
|
10
|
-
def method
|
11
|
-
@table[:method]
|
12
|
-
end
|
13
|
-
|
14
|
-
def params
|
15
|
-
@table
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def match_for(path, args = {}, protocol = "http://")
|
20
|
-
Merb::Router.match(SimpleRequest.new({:protocol => protocol, :path => path}.merge(args)))
|
21
|
-
end
|
22
|
-
|
23
|
-
def matched_route_for(*args)
|
24
|
-
# get route index
|
25
|
-
idx = match_for(*args)[0]
|
26
|
-
|
27
|
-
Merb::Router.routes[idx]
|
28
|
-
end
|
29
|
-
|
30
|
-
describe Merb::Router::Behavior, "#redirect" do
|
31
|
-
predicate_matchers[:redirect] = :redirects?
|
32
|
-
|
33
|
-
before :each do
|
34
|
-
Merb::Router.prepare do |r|
|
35
|
-
r.match('/old/location').redirect("/new/location", true)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
it "makes route redirecting" do
|
40
|
-
@behavior = matched_route_for("/old/location").behavior
|
41
|
-
@behavior.should redirect
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
describe Merb::Router::Behavior, "#defer_to" do
|
48
|
-
before :each do
|
49
|
-
Merb::Router.prepare do |r|
|
50
|
-
r.match("/deferred/:zoo").defer_to do |request, params|
|
51
|
-
params.merge(:controller => "w00t") if params[:zoo]
|
52
|
-
end
|
53
|
-
r.default_routes
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
it "registers route properly so it has index" do
|
58
|
-
matched_route_for("/deferred/abc").index.should_not be(nil)
|
59
|
-
end
|
60
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
Fri, 05 Sep 2008 23:42:49 GMT ~ info ~ Logfile created
|
2
|
-
~ Not Using Sessions
|
3
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
4
|
-
~ Not Using Sessions
|
5
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
6
|
-
~ Not Using Sessions
|
7
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
8
|
-
~ Not Using Sessions
|
9
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
10
|
-
~ Not Using Sessions
|
11
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
12
|
-
~ Not Using Sessions
|
13
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
14
|
-
~ Not Using Sessions
|
15
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
16
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
17
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
18
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
19
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
20
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
21
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
22
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
23
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
24
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
25
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
26
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
27
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
28
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
29
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
30
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
31
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
32
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
33
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
34
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
35
|
-
~ Starting Merb server listening at 0.0.0.0:4000
|
@@ -1,418 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
|
3
|
-
describe Merb::Router::Route, "initially" do
|
4
|
-
predicate_matchers[:allow_fixation] = :allow_fixation?
|
5
|
-
|
6
|
-
before :each do
|
7
|
-
Merb::Router.prepare do |r|
|
8
|
-
r.resources :continents do |c|
|
9
|
-
c.resources :countries
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
@r1 = Merb::Router.routes.first
|
14
|
-
@r5 = Merb::Router.routes[4]
|
15
|
-
end
|
16
|
-
|
17
|
-
after :each do
|
18
|
-
Merb::Router.reset!
|
19
|
-
end
|
20
|
-
|
21
|
-
it "has reader for conditions" do
|
22
|
-
@r1.conditions
|
23
|
-
end
|
24
|
-
|
25
|
-
it "has reader for params" do
|
26
|
-
@r1.params
|
27
|
-
end
|
28
|
-
|
29
|
-
it "has reader for behavior" do
|
30
|
-
@r5.behavior
|
31
|
-
end
|
32
|
-
|
33
|
-
it "has reader for conditional block" do
|
34
|
-
@r5.conditional_block
|
35
|
-
end
|
36
|
-
|
37
|
-
it "has reader for segments" do
|
38
|
-
@r5.segments
|
39
|
-
end
|
40
|
-
|
41
|
-
it "has reader for index" do
|
42
|
-
@r1.index.should == 0
|
43
|
-
end
|
44
|
-
|
45
|
-
it "has reader for symbol" do
|
46
|
-
@r1.symbol
|
47
|
-
end
|
48
|
-
|
49
|
-
it "does not allow fixation" do
|
50
|
-
@r1.should_not allow_fixation
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe Merb::Router::Route, "#fixatable" do
|
55
|
-
predicate_matchers[:allow_fixation] = :allow_fixation?
|
56
|
-
|
57
|
-
before :each do
|
58
|
-
Merb::Router.prepare do |r|
|
59
|
-
r.resources :continents do |c|
|
60
|
-
c.resources :countries
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
@route = Merb::Router.routes[4]
|
65
|
-
end
|
66
|
-
|
67
|
-
after :each do
|
68
|
-
Merb::Router.reset!
|
69
|
-
end
|
70
|
-
|
71
|
-
it "allows fixation when called with true" do
|
72
|
-
@route.fixatable(true)
|
73
|
-
|
74
|
-
@route.should allow_fixation
|
75
|
-
end
|
76
|
-
|
77
|
-
it "allows fixation when called with true" do
|
78
|
-
@route.fixatable(true)
|
79
|
-
@route.should allow_fixation
|
80
|
-
|
81
|
-
@route.fixatable(false)
|
82
|
-
@route.should_not allow_fixation
|
83
|
-
end
|
84
|
-
|
85
|
-
it "allows fixation when called with default argument" do
|
86
|
-
@route.fixatable
|
87
|
-
|
88
|
-
@route.should allow_fixation
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
describe Merb::Router::Route, "#to_s" do
|
95
|
-
before :each do
|
96
|
-
Merb::Router.prepare do |r|
|
97
|
-
r.resources :continents do |c|
|
98
|
-
c.resources :countries
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
@route = Merb::Router.routes[4]
|
103
|
-
end
|
104
|
-
|
105
|
-
after :each do
|
106
|
-
Merb::Router.reset!
|
107
|
-
end
|
108
|
-
|
109
|
-
it "concatenates route segments" do
|
110
|
-
@route.stub!(:segments).and_return(["continents/", "new"])
|
111
|
-
@route.to_s.should == "continents/new"
|
112
|
-
end
|
113
|
-
|
114
|
-
it "prefixes symbol segments with colon" do
|
115
|
-
@route.stub!(:segments).and_return(["continents/", :id])
|
116
|
-
@route.to_s.should == "continents/:id"
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
describe Merb::Router::Route, "#register" do
|
123
|
-
before :each do
|
124
|
-
Merb::Router.prepare do |r|
|
125
|
-
r.resources :continents do |c|
|
126
|
-
c.resources :countries
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
@route = Merb::Router.routes[4]
|
131
|
-
end
|
132
|
-
|
133
|
-
after :each do
|
134
|
-
Merb::Router.reset!
|
135
|
-
end
|
136
|
-
|
137
|
-
it "adds route to Merb routes set" do
|
138
|
-
Merb::Router.routes = []
|
139
|
-
@route.register
|
140
|
-
|
141
|
-
Merb::Router.routes.should include(@route)
|
142
|
-
end
|
143
|
-
|
144
|
-
it "sets index on route" do
|
145
|
-
Merb::Router.routes = []
|
146
|
-
@route.register
|
147
|
-
|
148
|
-
@route.index.should == 0
|
149
|
-
end
|
150
|
-
|
151
|
-
it "returns route itself" do
|
152
|
-
Merb::Router.routes = []
|
153
|
-
@route.register.should == @route
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
describe Merb::Router::Route, "#symbol_segments" do
|
160
|
-
before :each do
|
161
|
-
Merb::Router.prepare do |r|
|
162
|
-
r.resources :continents do |c|
|
163
|
-
c.resources :countries
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
@route = Merb::Router.routes[4]
|
168
|
-
end
|
169
|
-
|
170
|
-
after :each do
|
171
|
-
Merb::Router.reset!
|
172
|
-
end
|
173
|
-
|
174
|
-
it "cherrypicks segments that are Symbols" do
|
175
|
-
@route.stub!(:segments).and_return(["prefix/", :controller, "ping"])
|
176
|
-
@route.symbol_segments.should == [:controller]
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
describe Merb::Router::Route, "#segments_from_path" do
|
183
|
-
before :each do
|
184
|
-
Merb::Router.prepare do |r|
|
185
|
-
r.resources :continents do |c|
|
186
|
-
c.resources :countries
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
@route = Merb::Router.routes[4]
|
191
|
-
end
|
192
|
-
|
193
|
-
after :each do
|
194
|
-
Merb::Router.reset!
|
195
|
-
end
|
196
|
-
|
197
|
-
it "turns path into string and symbol segments" do
|
198
|
-
@route.segments_from_path("prefix/:controller/:action/:id").should == ["prefix/", :controller, "/", :action, "/", :id]
|
199
|
-
end
|
200
|
-
|
201
|
-
it "handles slash edge case just fine" do
|
202
|
-
@route.segments_from_path("/").should == ["/"]
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
describe Merb::Router::Route, "#name" do
|
209
|
-
before :each do
|
210
|
-
Merb::Router.prepare do |r|
|
211
|
-
r.match("/").to(:controller => "home")
|
212
|
-
end
|
213
|
-
|
214
|
-
@route = Merb::Router.routes.first
|
215
|
-
end
|
216
|
-
|
217
|
-
after :each do
|
218
|
-
Merb::Router.reset!
|
219
|
-
end
|
220
|
-
|
221
|
-
it "places the route into named routes collection" do
|
222
|
-
@route.name(:home)
|
223
|
-
|
224
|
-
Merb::Router.named_routes[:home].should == @route
|
225
|
-
end
|
226
|
-
|
227
|
-
it "only accepts Symbols" do
|
228
|
-
lambda { @route.name("home") }.should raise_error(ArgumentError)
|
229
|
-
end
|
230
|
-
|
231
|
-
end
|
232
|
-
|
233
|
-
|
234
|
-
describe Merb::Router::Route, "#regexp?" do
|
235
|
-
before :each do
|
236
|
-
Merb::Router.prepare do |r|
|
237
|
-
r.match(/api\/(.*)/).to(:controller => "api", :token => "[1]").name(:regexpy)
|
238
|
-
|
239
|
-
r.match("/what-is-regexps-dude").to(:controller => "plain_strings").name(:non_regexpy)
|
240
|
-
end
|
241
|
-
|
242
|
-
@regexp_route = Merb::Router.named_routes[:regexpy]
|
243
|
-
@non_regexp_route = Merb::Router.named_routes[:non_regexpy]
|
244
|
-
end
|
245
|
-
|
246
|
-
it "is true for routes that use regular expressions" do
|
247
|
-
@regexp_route.should be_regexp
|
248
|
-
end
|
249
|
-
|
250
|
-
it "is false for routes that do not explicitly use regular expressions" do
|
251
|
-
@non_regexp_route.should_not be_regexp
|
252
|
-
end
|
253
|
-
|
254
|
-
it "is true if behavior returns true when sent regexp?" do
|
255
|
-
@non_regexp_route.stub!(:behavior).and_return(stub("regexp_behavior", :regexp? => true))
|
256
|
-
@non_regexp_route.should be_regexp
|
257
|
-
end
|
258
|
-
|
259
|
-
it "is true if any of behavior's anscestors return true when sent regexp?" do
|
260
|
-
@regexp_ancestor = stub("regexp_ancestor", :regexp? => true)
|
261
|
-
@not_regexp_ancestor = stub("not_regexp_ancestor", :regexp? => false)
|
262
|
-
@behavior_with_ancestors = stub("regexp_behavior", :regexp? => false, :ancestors => [@regexp_ancestor, @not_regexp_ancestor])
|
263
|
-
|
264
|
-
@non_regexp_route.stub!(:behavior).and_return(@behavior_with_ancestors)
|
265
|
-
@non_regexp_route.should be_regexp
|
266
|
-
end
|
267
|
-
|
268
|
-
after :each do
|
269
|
-
Merb::Router.reset!
|
270
|
-
end
|
271
|
-
end
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
describe Merb::Router::Route, "#generate" do
|
276
|
-
before :each do
|
277
|
-
Merb::Router.prepare do |r|
|
278
|
-
r.match(/api\/(.*)/).to(:controller => "api", :token => "[1]").name(:regexpy)
|
279
|
-
r.match("/world/countries/:name").to(:controller => "countries").name(:non_regexpy)
|
280
|
-
end
|
281
|
-
|
282
|
-
@regexp_route = Merb::Router.named_routes[:regexpy]
|
283
|
-
@non_regexp_route = Merb::Router.named_routes[:non_regexpy]
|
284
|
-
end
|
285
|
-
|
286
|
-
after :each do
|
287
|
-
Merb::Router.reset!
|
288
|
-
end
|
289
|
-
|
290
|
-
it "does not work for regexp routes" do
|
291
|
-
lambda { @regexp_route.generate({ :token => "apitoken" }) }.should raise_error(RuntimeError, /regexp/)
|
292
|
-
end
|
293
|
-
|
294
|
-
it "replaces symbol segments in the URL with values from given Hash parameters" do
|
295
|
-
@non_regexp_route.generate({ :name => "Italy" }).should == "/world/countries/Italy"
|
296
|
-
@non_regexp_route.generate({ :name => "Brazil" }).should == "/world/countries/Brazil"
|
297
|
-
end
|
298
|
-
|
299
|
-
it "replaces symbol segments with Fixnum values just fine" do
|
300
|
-
@non_regexp_route.generate({ :name => 101 }).should == "/world/countries/101"
|
301
|
-
end
|
302
|
-
|
303
|
-
it "appends unknown symbol segments after ?" do
|
304
|
-
@non_regexp_route.generate({ :name => 101, :area => 10101 }).should == "/world/countries/101?area=10101"
|
305
|
-
end
|
306
|
-
|
307
|
-
it "calls #to_param on segments that respond to it" do
|
308
|
-
@non_regexp_route.generate({ :name => stub('US', :to_param => 'USA') }).should == "/world/countries/USA"
|
309
|
-
end
|
310
|
-
|
311
|
-
it "adds fragment after ?" do
|
312
|
-
@non_regexp_route.generate({:name => 101, :area => 10101, :fragment => :a_fragment}).should == "/world/countries/101?area=10101#a_fragment"
|
313
|
-
end
|
314
|
-
end
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
describe Merb::Router::Route, "#if_conditions" do
|
319
|
-
before :each do
|
320
|
-
Merb::Router.prepare do |r|
|
321
|
-
r.match(/api\/(.*)/).to(:controller => "api", :token => "[1]").name(:regexpy)
|
322
|
-
r.match("/world/countries/:name").to(:controller => "countries").name(:non_regexpy)
|
323
|
-
r.match("/world/continents/:continent/countries/:country").to(:controller => "world_map").name(:two_symbol_segments)
|
324
|
-
end
|
325
|
-
|
326
|
-
@regexp_route = Merb::Router.named_routes[:regexpy]
|
327
|
-
@non_regexp_route = Merb::Router.named_routes[:non_regexpy]
|
328
|
-
@two_symbol_route = Merb::Router.named_routes[:two_symbol_segments]
|
329
|
-
end
|
330
|
-
|
331
|
-
after :each do
|
332
|
-
Merb::Router.reset!
|
333
|
-
end
|
334
|
-
|
335
|
-
it "returns array with =~ statements" do
|
336
|
-
# just to show you what it looks like
|
337
|
-
@non_regexp_route.if_conditions({}).should == [" (/^\\/world\\/countries\\/([^\\/.,;?]+)$/ =~ cached_path) && (path1 = $1)"]
|
338
|
-
end
|
339
|
-
|
340
|
-
it "returns array of syntactically valid Ruby code statements that can be evaluated" do
|
341
|
-
cached_path = "/world/countries/Italy"
|
342
|
-
eval(@non_regexp_route.if_conditions({}).first)
|
343
|
-
# raises nothing and passes
|
344
|
-
end
|
345
|
-
|
346
|
-
it "works with regexp routes" do
|
347
|
-
cached_path = "/api/signin"
|
348
|
-
eval(@regexp_route.if_conditions({}).first)
|
349
|
-
# raises nothing and passes
|
350
|
-
end
|
351
|
-
|
352
|
-
it "adds conditions and match group for each symbol segment of route" do
|
353
|
-
# again, just to show you what it looks like
|
354
|
-
@two_symbol_route.if_conditions({}).should == [" (/^\\/world\\/continents\\/([^\\/.,;?]+)\\/countries\\/([^\\/.,;?]+)$/ =~ cached_path) && (path1, path2 = $1, $2)"]
|
355
|
-
end
|
356
|
-
end
|
357
|
-
|
358
|
-
describe Merb::Router::Route, "#if_conditions" do
|
359
|
-
before :each do
|
360
|
-
Merb::Router.prepare do |r|
|
361
|
-
r.match(/api\/(.*)/).to(:controller => "api", :token => "[1]").name(:regexpy)
|
362
|
-
r.match("/world/countries/:name").to(:controller => "countries").name(:non_regexpy)
|
363
|
-
r.match("/world/continents/:continent/countries/:country").to(:controller => "world_map").name(:two_symbol_segments)
|
364
|
-
end
|
365
|
-
|
366
|
-
@regexp_route = Merb::Router.named_routes[:regexpy]
|
367
|
-
@non_regexp_route = Merb::Router.named_routes[:non_regexpy]
|
368
|
-
@two_symbol_route = Merb::Router.named_routes[:two_symbol_segments]
|
369
|
-
end
|
370
|
-
|
371
|
-
after :each do
|
372
|
-
Merb::Router.reset!
|
373
|
-
end
|
374
|
-
|
375
|
-
it "uses if in compiled statement when argument is false" do
|
376
|
-
@regexp_route.compile(false).should =~ /\s*elsif/
|
377
|
-
end
|
378
|
-
|
379
|
-
it "uses elsif in compiled statement when argument is true" do
|
380
|
-
@non_regexp_route.compile(true).should =~ /^if/
|
381
|
-
end
|
382
|
-
|
383
|
-
it "uses if in compiled statement by default" do
|
384
|
-
@regexp_route.compile.should =~ /\s*elsif/
|
385
|
-
end
|
386
|
-
end
|
387
|
-
|
388
|
-
describe "Merb::Router::Route.capture" do
|
389
|
-
|
390
|
-
after :each do
|
391
|
-
Merb::Router.reset!
|
392
|
-
end
|
393
|
-
|
394
|
-
it "should capture routes that have been added in the block context" do
|
395
|
-
routes, named, route = [], {}, nil
|
396
|
-
Merb::Router.prepare do |r|
|
397
|
-
routes, named = Merb::Router.capture do
|
398
|
-
route = r.match("/overview").to(:controller => "home", :action => 'overview')
|
399
|
-
end
|
400
|
-
r.match("/").to(:controller => "home").name(:home)
|
401
|
-
end
|
402
|
-
routes.should include(route)
|
403
|
-
named.should_not include(route)
|
404
|
-
end
|
405
|
-
|
406
|
-
it "should capture named routes that have been added in the block context" do
|
407
|
-
routes, named, route = [], {}, nil
|
408
|
-
Merb::Router.prepare do |r|
|
409
|
-
r.match("/overview").to(:controller => "home", :action => 'overview')
|
410
|
-
routes, named = Merb::Router.capture do
|
411
|
-
route = r.match("/").to(:controller => "home").name(:home)
|
412
|
-
end
|
413
|
-
end
|
414
|
-
routes.should include(route)
|
415
|
-
named[:home].should == route
|
416
|
-
end
|
417
|
-
|
418
|
-
end
|