rad_core 0.0.13 → 0.0.14
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/Rakefile +4 -3
- data/lib/components/config.rb +6 -0
- data/lib/components/controller.rb +5 -0
- data/lib/components/controller.yml +3 -0
- data/lib/components/conveyors.rb +7 -0
- data/lib/components/environment.rb +5 -0
- data/lib/components/environment.yml +3 -0
- data/lib/components/flash.rb +5 -0
- data/lib/components/html.rb +4 -0
- data/lib/components/html.yml +3 -0
- data/lib/components/http.rb +6 -0
- data/lib/components/http.yml +13 -0
- data/lib/components/logger.rb +5 -0
- data/lib/components/mailer.rb +9 -0
- data/lib/components/remote.rb +4 -0
- data/lib/components/router.rb +13 -0
- data/lib/components/router.yml +2 -0
- data/lib/components/template.rb +8 -0
- data/lib/components/template.yml +1 -0
- data/lib/components/web.rb +8 -0
- data/lib/components/workspace.rb +1 -0
- data/lib/rad/{support → _support}/active_support/locales/en/actionpack.yml +0 -0
- data/lib/rad/{support → _support}/active_support/locales/en/activesupport.yml +0 -0
- data/lib/rad/_support/active_support/locales/ru/actionview.yml +162 -0
- data/lib/rad/_support/active_support/locales/ru/activesupport.yml +16 -0
- data/lib/rad/_support/active_support/locales/ru/datetime.yml +49 -0
- data/lib/rad/{support → _support}/active_support/micelaneous.rb +0 -0
- data/lib/rad/{support → _support}/active_support/time.rb +0 -0
- data/lib/rad/{support → _support}/active_support.rb +14 -2
- data/lib/rad/{support → _support}/addressable.rb +0 -0
- data/lib/rad/_support/callbacks.rb +166 -0
- data/lib/rad/_support/class_loader.rb +9 -0
- data/lib/rad/_support/encoding.rb +3 -0
- data/lib/rad/_support/exception.rb +45 -0
- data/lib/rad/_support/extensions.rb +20 -0
- data/lib/rad/_support/filters.rb +32 -0
- data/lib/rad/{support → _support}/hacks_and_fixes.rb +0 -0
- data/lib/rad/{support → _support}/mime.rb +6 -0
- data/lib/rad/{support → _support}/module.rb +7 -9
- data/lib/rad/_support/require.rb +62 -0
- data/lib/rad/{support → _support}/rson.rb +0 -0
- data/lib/rad/{support → _support}/ruby_ext_with_active_support.rb +0 -0
- data/lib/rad/{support → _support}/string.rb +9 -1
- data/lib/rad/controller/_abstract/micelaneous.rb +27 -0
- data/lib/rad/controller/_abstract/render.rb +159 -0
- data/lib/rad/controller/_abstract/responder.rb +13 -0
- data/lib/rad/controller/_abstract.rb +37 -0
- data/lib/rad/controller/_context.rb +15 -0
- data/lib/rad/controller/_http.rb +50 -0
- data/lib/rad/controller/_require.rb +19 -0
- data/lib/rad/controller/abstract.rb +1 -0
- data/lib/rad/controller/context.rb +1 -0
- data/lib/rad/controller/http.rb +1 -0
- data/lib/rad/controller/processors/controller_caller.rb +22 -24
- data/lib/rad/controller/processors/controller_error_handling.rb +46 -48
- data/lib/rad/controller/processors/controller_logger.rb +7 -9
- data/lib/rad/controller.rb +1 -28
- data/lib/rad/conveyors/_conveyor.rb +73 -0
- data/lib/rad/conveyors/_conveyors.rb +19 -0
- data/lib/rad/conveyors/_params.rb +10 -0
- data/lib/rad/conveyors/_processor.rb +13 -0
- data/lib/rad/conveyors/_require.rb +10 -0
- data/lib/rad/conveyors/_workspace.rb +34 -0
- data/lib/rad/conveyors/params.rb +1 -0
- data/lib/rad/conveyors/processor.rb +1 -0
- data/lib/rad/conveyors/processors/conveyor_logger.rb +23 -0
- data/lib/rad/conveyors/workspace.rb +1 -0
- data/lib/rad/conveyors.rb +1 -0
- data/lib/rad/core_web/_controller_micelaneous_helper.rb +17 -0
- data/lib/rad/core_web/_require.rb +25 -0
- data/lib/rad/core_web/_router/abstract_routing_helper.rb +20 -0
- data/lib/rad/core_web/_router/controller_routing_helper.rb +56 -0
- data/lib/rad/core_web/_router/view_routing_helper.rb +57 -0
- data/lib/rad/environment/_config.rb +27 -0
- data/lib/rad/environment/_environment.rb +17 -0
- data/lib/rad/environment/_files_helper.rb +55 -0
- data/lib/rad/environment/_logger.rb +53 -0
- data/lib/rad/environment/_require.rb +24 -0
- data/lib/rad/environment/config.rb +1 -111
- data/lib/rad/environment.rb +1 -55
- data/lib/{rad_core → rad}/gems.rb +2 -3
- data/lib/rad/html/_flash.rb +40 -0
- data/lib/rad/html/_helpers/basic_html_helper.rb +72 -0
- data/lib/rad/html/_helpers/flash_helper.rb +3 -0
- data/lib/rad/html/_helpers/form_helper.rb +114 -0
- data/lib/rad/html/_helpers/html_helper.rb +3 -0
- data/lib/rad/html/_helpers/javascript_helper.rb +27 -0
- data/lib/rad/html/_helpers/model_helper.rb +143 -0
- data/lib/rad/html/_require.rb +15 -0
- data/lib/rad/html/processors/prepare_flash.rb +22 -23
- data/lib/rad/html/processors/scoped_params.rb +18 -21
- data/lib/rad/html.rb +1 -26
- data/lib/rad/http/_http.rb +11 -0
- data/lib/rad/http/_http_adapter.rb +44 -0
- data/lib/rad/http/_request.rb +50 -0
- data/lib/rad/http/_require.rb +33 -0
- data/lib/rad/http/_response.rb +84 -0
- data/lib/rad/http/{support → _support}/rack/fixes.rb +0 -0
- data/lib/rad/http/_support/rack/rack_adapter.rb +57 -0
- data/lib/rad/http/processors/evaluate_format.rb +16 -19
- data/lib/rad/http/processors/http_logger.rb +10 -12
- data/lib/rad/http/processors/http_writer.rb +24 -26
- data/lib/rad/http/processors/prepare_params.rb +19 -18
- data/lib/rad/http/request.rb +1 -0
- data/lib/rad/http/response.rb +1 -0
- data/lib/rad/http.rb +1 -48
- data/lib/rad/mailer/_letter.rb +28 -0
- data/lib/rad/mailer/_mailer.rb +13 -0
- data/lib/rad/mailer/_mailer_controller.rb +38 -0
- data/lib/rad/mailer/_require.rb +7 -0
- data/lib/rad/mailer/mailer_controller.rb +1 -0
- data/lib/rad/mailer/processors/letter_builder.rb +34 -0
- data/lib/rad/mailer.rb +1 -0
- data/lib/rad/profiles/mailer.rb +5 -0
- data/lib/rad/profiles/web.rb +29 -52
- data/lib/rad/remote/_remote_controller.rb +9 -0
- data/lib/rad/remote/_require.rb +6 -0
- data/lib/rad/remote/processors/remote_caller.rb +44 -46
- data/lib/rad/remote/processors/remote_logger.rb +8 -10
- data/lib/rad/remote/remote_controller.rb +1 -0
- data/lib/rad/remote.rb +1 -9
- data/lib/rad/router/_abstract_router.rb +50 -0
- data/lib/rad/router/_alias_router.rb +124 -0
- data/lib/rad/router/_basic_router.rb +72 -0
- data/lib/rad/router/_configurator.rb +19 -0
- data/lib/rad/router/_core_routing_helper.rb +39 -0
- data/lib/rad/router/_default_format_processor.rb +10 -0
- data/lib/rad/router/_object_router.rb +184 -0
- data/lib/rad/router/_require.rb +31 -0
- data/lib/rad/router/_restful_router.rb +124 -0
- data/lib/rad/router/_router.rb +294 -0
- data/lib/rad/router/_simple_router.rb +21 -0
- data/lib/rad/router/abstract_router.rb +1 -0
- data/lib/rad/router/alias_router.rb +1 -0
- data/lib/rad/router/configurator.rb +1 -0
- data/lib/rad/router/micelaneous_router.rb +1 -0
- data/lib/rad/router/object_router.rb +1 -0
- data/lib/rad/router/processors/router.rb +23 -0
- data/lib/rad/router/restful_router.rb +1 -0
- data/lib/rad/{html/include_into_controller.rb → router/simple_router.rb} +0 -0
- data/lib/rad/router.rb +1 -29
- data/lib/rad/spec/controller.rb +20 -11
- data/lib/rad/spec/environment.rb +22 -38
- data/lib/rad/spec/http.rb +13 -86
- data/lib/rad/spec/http_controller.rb +105 -0
- data/lib/rad/spec/mailer.rb +27 -0
- data/lib/rad/spec/remote.rb +2 -2
- data/lib/rad/spec/router.rb +9 -11
- data/lib/rad/spec/template.rb +8 -2
- data/lib/rad/spec/xhtml.rb +0 -2
- data/lib/rad/spec.rb +4 -2
- data/lib/rad/template/_context.rb +92 -0
- data/lib/rad/template/_relative_path_resolver.rb +8 -0
- data/lib/rad/template/_require.rb +15 -0
- data/lib/rad/template/{support → _support}/tilt.rb +0 -0
- data/lib/rad/template/{support → _support}/tilt_fixes.rb +0 -0
- data/lib/rad/template/_template.rb +175 -0
- data/lib/rad/template/template_context.rb +1 -62
- data/lib/rad/template.rb +1 -25
- data/lib/rad.rb +8 -0
- data/readme.md +40 -12
- data/spec/controller/{abstract_controller_spec → abstract_spec}/views/OperationsOrderSpec/action.erb +0 -0
- data/spec/controller/{abstract_controller_spec → abstract_spec}/views/ViewVariablesSpec/action.erb +0 -0
- data/spec/controller/abstract_spec.rb +126 -0
- data/spec/controller/{controller_context_spec/views/ItemSpec → context_spec/views/NamespaceSpec/ClassSpec}/show.erb +0 -0
- data/spec/controller/{controller_context_spec/views/ItemSpec → context_spec/views/item_spec}/actions.erb +0 -0
- data/spec/controller/{controller_context_spec/views/NamespaceSpec/ClassSpec → context_spec/views/item_spec}/show.erb +0 -0
- data/spec/controller/{controller_context_spec/views/ItemSpec → context_spec/views/item_spec}/update.erb +0 -0
- data/spec/controller/{controller_context_spec → context_spec}/views/namespace_spec/class_spec/update.erb +0 -0
- data/spec/controller/{controller_context_spec/views/PageSpec → context_spec/views/page_spec}/actions.erb +0 -0
- data/spec/controller/{controller_context_spec/views/PageSpec → context_spec/views/page_spec}/show.erb +0 -0
- data/spec/controller/context_spec.rb +123 -0
- data/spec/controller/error_handling_spec.rb +21 -27
- data/spec/controller/{controller_helper_spec → helper_spec}/views/HelperMethodSpec/action.erb +0 -0
- data/spec/controller/{controller_helper_spec → helper_spec}/views/HelperSpec/action.erb +0 -0
- data/spec/controller/{controller_helper_spec.rb → helper_spec.rb} +7 -13
- data/spec/controller/{http_controller_spec.rb → http_spec.rb} +17 -23
- data/spec/controller/{controller_render_spec/views/AlreadyRenderedSpec → render_spec/views/already_rendered_spec}/action.erb +0 -0
- data/spec/controller/{controller_render_spec/views/AlreadyRenderedSpec → render_spec/views/already_rendered_spec}/custom_template.erb +0 -0
- data/spec/controller/{controller_render_spec/views/AnotherActionSpec → render_spec/views/another_action_spec}/another_action.erb +0 -0
- data/spec/controller/{controller_render_spec/views/AnotherLayout → render_spec/views/another_layout}/action.erb +0 -0
- data/spec/controller/{controller_render_spec/views/ForbidPartialAsActionSpec → render_spec/views/forbid_partial_as_action_spec}/_action.erb +0 -0
- data/spec/controller/{controller_render_spec/views/FormatSpec → render_spec/views/format_spec}/action.html.erb +0 -0
- data/spec/controller/{controller_render_spec/views/FormatSpec → render_spec/views/format_spec}/action.js.erb +0 -0
- data/spec/controller/{controller_render_spec/views/LayoutFiltersSpec → render_spec/views/layout_filters_spec}/action_with_layout.erb +0 -0
- data/spec/controller/{controller_render_spec/views/LayoutFiltersSpec → render_spec/views/layout_filters_spec}/action_without_layout.erb +0 -0
- data/spec/controller/{controller_render_spec/views/LayoutSpec → render_spec/views/layout_spec}/action.erb +0 -0
- data/spec/controller/{controller_render_spec → render_spec}/views/layouts/admin.erb +0 -0
- data/spec/controller/{controller_render_spec → render_spec}/views/layouts/app.html.erb +0 -0
- data/spec/controller/{controller_render_spec → render_spec}/views/layouts/app.js.erb +0 -0
- data/spec/controller/{controller_render_spec/views/MultipleActions → render_spec/views/multiple_actions}/actions.haml +0 -0
- data/spec/controller/render_spec/views/relative_spec/a/form.erb +1 -0
- data/spec/controller/render_spec/views/relative_spec/a/show.erb +1 -0
- data/spec/controller/render_spec/views/relative_spec/b/form.erb +1 -0
- data/spec/controller/{controller_render_spec → render_spec}/views/some_template.erb +0 -0
- data/spec/controller/{controller_render_spec → render_spec}/views/standalone.html.erb +0 -0
- data/spec/controller/{controller_render_spec.rb → render_spec.rb} +37 -27
- data/spec/{conveyor/conveyor_spec.rb → conveyors/conveyors_spec.rb} +36 -14
- data/spec/environment/config_spec.rb +13 -21
- data/spec/environment/environment_spec.rb +14 -41
- data/spec/environment/logger_spec.rb +4 -13
- data/spec/environment/minimal_app_spec/app.rb +1 -1
- data/spec/environment/minimal_app_spec.rb +12 -14
- data/spec/environment/standard_app_spec/app/lib/app/init.rb +1 -1
- data/spec/environment/standard_app_spec/plugin_a/lib/plugin_a/init.rb +1 -1
- data/spec/environment/standard_app_spec.rb +17 -25
- data/spec/html/basic_html_helper_spec.rb +7 -4
- data/spec/html/form_helper_spec.rb +5 -5
- data/spec/html/javascript_helper_spec.rb +9 -5
- data/spec/html/model_helper_spec.rb +9 -6
- data/spec/html/scoped_params_spec.rb +2 -2
- data/spec/html/spec_helper.rb +16 -24
- data/spec/http/http_spec.rb +14 -35
- data/spec/http/micelaneous_spec.rb +3 -3
- data/spec/{mail → mailer}/mail_controller_spec/views/body_template_spec/signup.erb +0 -0
- data/spec/{mail → mailer}/mail_controller_spec.rb +36 -12
- data/spec/mailer/spec_helper.rb +5 -0
- data/spec/remote/remote_spec.rb +23 -8
- data/spec/router/alias_router_spec.rb +29 -30
- data/spec/router/basic_router_spec.rb +44 -0
- data/spec/router/configurator_spec.rb +9 -6
- data/spec/router/integration_spec.rb +10 -7
- data/spec/router/object_router_spec.rb +186 -0
- data/spec/router/persistent_params_spec.rb +4 -4
- data/spec/router/restful_router_spec.rb +61 -53
- data/spec/router/{basic_spec.rb → router_spec.rb} +26 -23
- data/spec/router/routing_helper_spec.rb +5 -6
- data/spec/spec_helper.rb +4 -0
- data/spec/support/callbacks_spec.rb +1 -1
- data/spec/support/filters_spec.rb +2 -2
- data/spec/support/spec_helper.rb +1 -1
- data/spec/template/template_spec/views/format_for_partials/dialog.js.erb +1 -1
- data/spec/template/template_spec/views/nested/format/a.erb +1 -1
- data/spec/template/template_spec/views/nested/format/b.js.erb +1 -0
- data/spec/template/template_spec/views/nesting_format/dialog.js.erb +1 -1
- data/spec/template/template_spec.rb +62 -48
- data/spec/template/tilt_spec/views/concat_and_capture.erb +1 -1
- data/spec/template/tilt_spec/views/concat_and_capture.haml +1 -1
- data/spec/template/tilt_spec.rb +17 -19
- data/spec/{integration → web}/basic_spec/views/smoke_test_spec/action.erb +0 -0
- data/spec/{integration → web}/basic_spec.rb +31 -12
- data/spec/{integration → web}/controller_routing_helper_spec.rb +13 -11
- data/spec/{integration → web}/flash_spec.rb +57 -42
- data/spec/{integration → web}/spec_helper_spec.rb +11 -10
- data/spec/{integration → web}/view_routing_helper_spec.rb +44 -36
- metadata +338 -318
- data/lib/rad/controller/abstract_controller/micelaneous.rb +0 -31
- data/lib/rad/controller/abstract_controller/render.rb +0 -160
- data/lib/rad/controller/abstract_controller/responder.rb +0 -17
- data/lib/rad/controller/abstract_controller.rb +0 -64
- data/lib/rad/controller/controller_context.rb +0 -15
- data/lib/rad/controller/http_controller.rb +0 -48
- data/lib/rad/conveyor/conveyor.rb +0 -74
- data/lib/rad/conveyor/conveyors.rb +0 -20
- data/lib/rad/conveyor/params.rb +0 -14
- data/lib/rad/conveyor/processor.rb +0 -68
- data/lib/rad/conveyor/processors/conveyor_logger.rb +0 -25
- data/lib/rad/conveyor/workspace.rb +0 -36
- data/lib/rad/conveyor.rb +0 -29
- data/lib/rad/environment/dependency_resolver.rb +0 -107
- data/lib/rad/environment/environment.rb +0 -29
- data/lib/rad/environment/files_helper.rb +0 -55
- data/lib/rad/environment/logger.rb +0 -21
- data/lib/rad/html/flash.rb +0 -42
- data/lib/rad/html/helpers/basic_html_helper.rb +0 -83
- data/lib/rad/html/helpers/flash_helper.rb +0 -5
- data/lib/rad/html/helpers/form_helper.rb +0 -115
- data/lib/rad/html/helpers/html_helper.rb +0 -5
- data/lib/rad/html/helpers/javascript_helper.rb +0 -18
- data/lib/rad/html/helpers/model_helper.rb +0 -135
- data/lib/rad/http/http.rb +0 -21
- data/lib/rad/http/http_adapter.rb +0 -36
- data/lib/rad/http/middleware/static_files.rb +0 -21
- data/lib/rad/http/support/rack/rack_adapter.rb +0 -67
- data/lib/rad/http/support/rack/request.rb +0 -42
- data/lib/rad/http/support/rack/response.rb +0 -86
- data/lib/rad/integration/controller_micelaneous_helper.rb +0 -19
- data/lib/rad/integration/router/abstract_routing_helper.rb +0 -22
- data/lib/rad/integration/router/controller_routing_helper.rb +0 -58
- data/lib/rad/integration/router/view_routing_helper.rb +0 -104
- data/lib/rad/integration.rb +0 -30
- data/lib/rad/mail/letter.rb +0 -30
- data/lib/rad/mail/mail_controller.rb +0 -31
- data/lib/rad/mail/mailer.rb +0 -23
- data/lib/rad/mail/processors/letter_builder.rb +0 -36
- data/lib/rad/mail.rb +0 -15
- data/lib/rad/profiles/mail.rb +0 -16
- data/lib/rad/profiles/web_require.rb +0 -5
- data/lib/rad/remote/remote.rb +0 -15
- data/lib/rad/router/core/configurator.rb +0 -25
- data/lib/rad/router/core/core_routing_helper.rb +0 -41
- data/lib/rad/router/core/default_format_processor.rb +0 -12
- data/lib/rad/router/core/processors/router.rb +0 -29
- data/lib/rad/router/core/router.rb +0 -271
- data/lib/rad/router/core/simple_router.rb +0 -23
- data/lib/rad/router/routers/abstract_router.rb +0 -62
- data/lib/rad/router/routers/alias_router.rb +0 -113
- data/lib/rad/router/routers/restful_router.rb +0 -113
- data/lib/rad/spec/mail.rb +0 -31
- data/lib/rad/spec/view.rb +0 -10
- data/lib/rad/support/buffered_logger.rb +0 -44
- data/lib/rad/support/callbacks.rb +0 -168
- data/lib/rad/support/exception.rb +0 -31
- data/lib/rad/support/filters.rb +0 -34
- data/lib/rad/support/format.rb +0 -17
- data/lib/rad/support/micon.rb +0 -13
- data/lib/rad/support.rb +0 -63
- data/lib/rad/template/template.rb +0 -250
- data/spec/controller/abstract_controller_spec.rb +0 -132
- data/spec/controller/controller_context_spec.rb +0 -123
- data/spec/controller/controller_render_spec/views/rem ExplicitRenderSpec/action.erb +0 -1
- data/spec/controller/controller_render_spec/views/rem ExplicitRenderSpec/another_action.erb +0 -1
- data/spec/controller/spec_helper.rb +0 -19
- data/spec/conveyor/spec_helper.rb +0 -3
- data/spec/environment/config_spec/config.default.yml +0 -3
- data/spec/environment/config_spec/config.development.yml +0 -3
- data/spec/environment/config_spec/config.yml +0 -5
- data/spec/environment/spec_helper.rb +0 -1
- data/spec/http/http_spec/app/lib/app/init.rb +0 -10
- data/spec/http/http_spec/app/runtime/public/emptygit +0 -0
- data/spec/http/http_spec/plugin_a/lib/plugin_a/init.rb +0 -0
- data/spec/http/http_spec/plugin_b/lib/plugin_b/init.rb +0 -5
- data/spec/http/http_spec/plugin_b/static/emptygit +0 -0
- data/spec/http/spec_helper.rb +0 -5
- data/spec/integration/spec_helper.rb +0 -5
- data/spec/mail/spec_helper.rb +0 -7
- data/spec/remote/spec_helper.rb +0 -17
- data/spec/router/spec_helper.rb +0 -20
- data/spec/template/spec_helper.rb +0 -6
- data/spec/template/template_spec/views/nested/format/b.erb +0 -1
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
require "
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
describe "Error handling" do
|
|
4
|
-
with_environment
|
|
5
4
|
with_view_path "#{spec_dir}/views"
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
AbstractController = Rad::AbstractController
|
|
9
|
-
|
|
10
|
-
rad.before :environment do
|
|
11
|
-
rad.config.test_error_template = rad.config.development_error_template!
|
|
12
|
-
end
|
|
6
|
+
isolate :conveyors
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
before do
|
|
9
|
+
rad.controller.stub!(:test_error_template).and_return(rad.controller.development_error_template)
|
|
10
|
+
|
|
11
|
+
rad.conveyors.web do |web|
|
|
12
|
+
web.use Rad::Controller::Processors::ControllerErrorHandling
|
|
13
|
+
web.use Rad::Controller::Processors::ControllerCaller
|
|
19
14
|
end
|
|
20
15
|
end
|
|
21
|
-
|
|
16
|
+
|
|
17
|
+
before :all do
|
|
18
|
+
rad.controller
|
|
19
|
+
end
|
|
22
20
|
after :all do
|
|
23
21
|
remove_constants %w(
|
|
24
22
|
DisplayErrorWithFormat
|
|
25
|
-
DiferrentErrorHandlingSpec
|
|
26
|
-
AbstractController
|
|
23
|
+
DiferrentErrorHandlingSpec
|
|
27
24
|
ErrorInRedirectSpec
|
|
28
25
|
)
|
|
29
26
|
end
|
|
30
27
|
|
|
31
28
|
it "should correctly display error messages in :development (with correct format)" do
|
|
32
29
|
class ::DisplayErrorWithFormat
|
|
33
|
-
inherit
|
|
30
|
+
inherit Rad::Controller::Abstract
|
|
34
31
|
|
|
35
32
|
def method
|
|
36
33
|
raise params.error
|
|
37
34
|
end
|
|
38
35
|
end
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
silence_logger!
|
|
37
|
+
rad.mode = :development, true
|
|
42
38
|
|
|
43
39
|
error = StandardError.new('some error')
|
|
44
40
|
|
|
@@ -63,7 +59,7 @@ describe "Error handling" do
|
|
|
63
59
|
# after error will be catched and no error message will be displayed
|
|
64
60
|
|
|
65
61
|
class ::ErrorInRedirectSpec
|
|
66
|
-
inherit
|
|
62
|
+
inherit Rad::Controller::Abstract
|
|
67
63
|
|
|
68
64
|
def a
|
|
69
65
|
response.headers['Location'] = '/'
|
|
@@ -71,8 +67,7 @@ describe "Error handling" do
|
|
|
71
67
|
end
|
|
72
68
|
end
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
silence_logger!
|
|
70
|
+
rad.mode = :development, true
|
|
76
71
|
|
|
77
72
|
ccall(ErrorInRedirectSpec, :a, format: 'html')
|
|
78
73
|
response.headers['Location'].should be_nil
|
|
@@ -81,7 +76,7 @@ describe "Error handling" do
|
|
|
81
76
|
describe "should be different in :test, :development and :production" do
|
|
82
77
|
before :all do
|
|
83
78
|
class ::DiferrentErrorHandlingSpec
|
|
84
|
-
inherit
|
|
79
|
+
inherit Rad::Controller::Abstract
|
|
85
80
|
|
|
86
81
|
def a; end
|
|
87
82
|
def b
|
|
@@ -94,8 +89,7 @@ describe "Error handling" do
|
|
|
94
89
|
it "in :production errors shouldn't be shown to user"
|
|
95
90
|
|
|
96
91
|
it "in development errors should be catched" do
|
|
97
|
-
|
|
98
|
-
silence_logger!
|
|
92
|
+
rad.mode = :development, true
|
|
99
93
|
|
|
100
94
|
# with view
|
|
101
95
|
ccall(DiferrentErrorHandlingSpec, :a).should == 'a'
|
|
@@ -106,8 +100,8 @@ describe "Error handling" do
|
|
|
106
100
|
end
|
|
107
101
|
|
|
108
102
|
it "should not catch errors in :test environment" do
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
rad.mode = :test, true
|
|
104
|
+
|
|
111
105
|
# with render
|
|
112
106
|
ccall(DiferrentErrorHandlingSpec, :a).should == 'a'
|
|
113
107
|
lambda{ccall(DiferrentErrorHandlingSpec, :b)}.should raise_error(/some error/)
|
data/spec/controller/{controller_helper_spec → helper_spec}/views/HelperMethodSpec/action.erb
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
require "
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
|
-
describe "
|
|
4
|
-
with_environment
|
|
5
|
-
with_abstract_controller_spec
|
|
3
|
+
describe "Abstract" do
|
|
6
4
|
with_view_path "#{spec_dir}/views"
|
|
7
|
-
|
|
8
|
-
before :all do
|
|
9
|
-
AbstractController = Rad::AbstractController
|
|
10
|
-
end
|
|
5
|
+
with_abstract_controller
|
|
11
6
|
|
|
12
7
|
after :all do
|
|
13
8
|
remove_constants %w(
|
|
14
9
|
SomeHelperSpec
|
|
15
10
|
HelperSpec
|
|
16
|
-
HelperMethodSpec
|
|
17
|
-
AbstractController
|
|
11
|
+
HelperMethodSpec
|
|
18
12
|
)
|
|
19
13
|
end
|
|
20
14
|
|
|
21
15
|
it "helper_method" do
|
|
22
16
|
class ::HelperMethodSpec
|
|
23
|
-
inherit
|
|
17
|
+
inherit Rad::Controller::Abstract
|
|
24
18
|
|
|
25
19
|
def some_controller_method
|
|
26
20
|
"some controller value (rendered in cotext of #{self.class})"
|
|
@@ -41,13 +35,13 @@ describe "AbstractController" do
|
|
|
41
35
|
end
|
|
42
36
|
|
|
43
37
|
class ::HelperSpec
|
|
44
|
-
inherit
|
|
38
|
+
inherit Rad::Controller::Abstract
|
|
45
39
|
|
|
46
40
|
helper SomeHelperSpec
|
|
47
41
|
|
|
48
42
|
def action; end
|
|
49
43
|
end
|
|
50
44
|
|
|
51
|
-
ccall(HelperSpec, :action).should == "some wighet (rendered in context of HelperSpec::
|
|
45
|
+
ccall(HelperSpec, :action).should == "some wighet (rendered in context of HelperSpec::HelperSpecContext)"
|
|
52
46
|
end
|
|
53
47
|
end
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
require "
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
|
-
describe "
|
|
4
|
-
|
|
5
|
-
with_http
|
|
3
|
+
describe "Http" do
|
|
4
|
+
isolate :conveyors
|
|
6
5
|
|
|
7
|
-
before
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
rad.conveyors.web do |web|
|
|
12
|
-
web.use Rad::Processors::HttpWriter
|
|
13
|
-
web.use Rad::Processors::ControllerCaller
|
|
14
|
-
end
|
|
6
|
+
before do
|
|
7
|
+
rad.conveyors.web do |web|
|
|
8
|
+
web.use Rad::Http::Processors::HttpWriter
|
|
9
|
+
web.use Rad::Controller::Processors::ControllerCaller
|
|
15
10
|
end
|
|
16
11
|
end
|
|
17
|
-
|
|
12
|
+
|
|
18
13
|
after :all do
|
|
19
|
-
remove_constants %w(
|
|
20
|
-
HttpController
|
|
14
|
+
remove_constants %w(
|
|
21
15
|
ContentTypeSpec
|
|
22
16
|
StatusSpec
|
|
23
17
|
StatusShortcutsSpec
|
|
@@ -26,11 +20,11 @@ describe "HttpController" do
|
|
|
26
20
|
ForbidGetSpec
|
|
27
21
|
)
|
|
28
22
|
end
|
|
29
|
-
|
|
23
|
+
|
|
30
24
|
describe 'render' do
|
|
31
25
|
it "should take :content_type option" do
|
|
32
26
|
class ::ContentTypeSpec
|
|
33
|
-
inherit
|
|
27
|
+
inherit Rad::Controller::Http
|
|
34
28
|
|
|
35
29
|
def action
|
|
36
30
|
render inline: "some content", content_type: Mime.js
|
|
@@ -43,7 +37,7 @@ describe "HttpController" do
|
|
|
43
37
|
|
|
44
38
|
it "should take :status option" do
|
|
45
39
|
class ::StatusSpec
|
|
46
|
-
inherit
|
|
40
|
+
inherit Rad::Controller::Http
|
|
47
41
|
|
|
48
42
|
def action
|
|
49
43
|
render inline: "some content", status: 220
|
|
@@ -56,7 +50,7 @@ describe "HttpController" do
|
|
|
56
50
|
|
|
57
51
|
it "should take shortcuts to status codes" do
|
|
58
52
|
class ::StatusShortcutsSpec
|
|
59
|
-
inherit
|
|
53
|
+
inherit Rad::Controller::Http
|
|
60
54
|
|
|
61
55
|
def ok
|
|
62
56
|
render :ok
|
|
@@ -76,7 +70,7 @@ describe "HttpController" do
|
|
|
76
70
|
|
|
77
71
|
it "should take :location option" do
|
|
78
72
|
class ::LocationSpec
|
|
79
|
-
inherit
|
|
73
|
+
inherit Rad::Controller::Http
|
|
80
74
|
|
|
81
75
|
def action
|
|
82
76
|
render location: "/"
|
|
@@ -101,8 +95,8 @@ describe "HttpController" do
|
|
|
101
95
|
|
|
102
96
|
it "should specify request method" do
|
|
103
97
|
class ::RequestMethod
|
|
104
|
-
inherit
|
|
105
|
-
def action
|
|
98
|
+
inherit Rad::Controller::Http
|
|
99
|
+
def action
|
|
106
100
|
workspace.request.post?.should == true
|
|
107
101
|
end
|
|
108
102
|
end
|
|
@@ -113,7 +107,7 @@ describe "HttpController" do
|
|
|
113
107
|
|
|
114
108
|
it "should protect methods from GET request" do
|
|
115
109
|
class ::ForbidGetSpec
|
|
116
|
-
inherit
|
|
110
|
+
inherit Rad::Controller::Http
|
|
117
111
|
allow_get_for :get_action
|
|
118
112
|
|
|
119
113
|
def get_action; end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
form a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= render 'form' %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
form b
|
|
File without changes
|
|
File without changes
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
require "
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
describe "Controller render" do
|
|
4
|
-
with_environment
|
|
5
|
-
with_abstract_controller_spec
|
|
6
4
|
with_view_path "#{spec_dir}/views"
|
|
7
|
-
|
|
8
|
-
before :all do
|
|
9
|
-
AbstractController = Rad::AbstractController
|
|
10
|
-
end
|
|
5
|
+
with_abstract_controller
|
|
11
6
|
|
|
12
7
|
after :all do
|
|
13
8
|
remove_constants %w(
|
|
@@ -21,17 +16,17 @@ describe "Controller render" do
|
|
|
21
16
|
AlreadyRenderedSpec
|
|
22
17
|
SpecialFormatSpec
|
|
23
18
|
AnotherActionSpec
|
|
24
|
-
InlineRenderSpec
|
|
25
|
-
AbstractController
|
|
19
|
+
InlineRenderSpec
|
|
26
20
|
InlineWithLayoutSpec
|
|
27
21
|
MultipleActions
|
|
22
|
+
RelativeSpec
|
|
28
23
|
)
|
|
29
24
|
end
|
|
30
25
|
|
|
31
26
|
describe 'layout' do
|
|
32
27
|
it "should use :except and :only in layout" do
|
|
33
28
|
class ::LayoutFiltersSpec
|
|
34
|
-
inherit
|
|
29
|
+
inherit Rad::Controller::Abstract
|
|
35
30
|
layout '/layouts/app', only: :action_with_layout
|
|
36
31
|
|
|
37
32
|
def action_with_layout; end
|
|
@@ -44,7 +39,7 @@ describe "Controller render" do
|
|
|
44
39
|
|
|
45
40
|
it "should apply formats to layout" do
|
|
46
41
|
class LayoutSpec
|
|
47
|
-
inherit
|
|
42
|
+
inherit Rad::Controller::Abstract
|
|
48
43
|
layout '/layouts/app'
|
|
49
44
|
|
|
50
45
|
def action; end
|
|
@@ -56,7 +51,7 @@ describe "Controller render" do
|
|
|
56
51
|
|
|
57
52
|
it "should take layout: false or layout: '/another_layout'" do
|
|
58
53
|
class AnotherLayout
|
|
59
|
-
inherit
|
|
54
|
+
inherit Rad::Controller::Abstract
|
|
60
55
|
layout '/layout/app'
|
|
61
56
|
|
|
62
57
|
def action; end
|
|
@@ -77,7 +72,7 @@ describe "Controller render" do
|
|
|
77
72
|
|
|
78
73
|
it "should take into account :layout when rendering template" do
|
|
79
74
|
class ::ExplicitRenderSpec
|
|
80
|
-
inherit
|
|
75
|
+
inherit Rad::Controller::Abstract
|
|
81
76
|
layout '/layouts/app'
|
|
82
77
|
|
|
83
78
|
def with_layout
|
|
@@ -96,7 +91,7 @@ describe "Controller render" do
|
|
|
96
91
|
|
|
97
92
|
it "should render template inside of controller" do
|
|
98
93
|
class ::RenderInsideOfControllerSpec
|
|
99
|
-
inherit
|
|
94
|
+
inherit Rad::Controller::Abstract
|
|
100
95
|
|
|
101
96
|
def some_action
|
|
102
97
|
render '/some_template'
|
|
@@ -108,16 +103,16 @@ describe "Controller render" do
|
|
|
108
103
|
|
|
109
104
|
it "should not allow to render partials as actions" do
|
|
110
105
|
class ::ForbidPartialAsActionSpec
|
|
111
|
-
inherit
|
|
106
|
+
inherit Rad::Controller::Abstract
|
|
112
107
|
def action; end
|
|
113
108
|
end
|
|
114
109
|
|
|
115
|
-
|
|
110
|
+
ccall(ForbidPartialAsActionSpec, :action).should == ''
|
|
116
111
|
end
|
|
117
112
|
|
|
118
113
|
it "should render view with right format" do
|
|
119
114
|
class FormatSpec
|
|
120
|
-
inherit
|
|
115
|
+
inherit Rad::Controller::Abstract
|
|
121
116
|
def action; end
|
|
122
117
|
end
|
|
123
118
|
|
|
@@ -125,16 +120,16 @@ describe "Controller render" do
|
|
|
125
120
|
ccall(FormatSpec, :action, format: 'js').should == "js format"
|
|
126
121
|
end
|
|
127
122
|
|
|
128
|
-
it "should be able to use
|
|
129
|
-
|
|
123
|
+
it "should be able to use rad.template.render for different purposes (mail for example)" do
|
|
124
|
+
rad.template.render("/standalone", locals: {a: 'a'}).should == 'standalone usage, a'
|
|
130
125
|
end
|
|
131
126
|
|
|
132
127
|
it "should not rener if already rendered in controller" do
|
|
133
128
|
class ::AlreadyRenderedSpec
|
|
134
|
-
inherit
|
|
129
|
+
inherit Rad::Controller::Abstract
|
|
135
130
|
|
|
136
131
|
def action
|
|
137
|
-
render '/
|
|
132
|
+
render '/already_rendered_spec/custom_template'
|
|
138
133
|
end
|
|
139
134
|
end
|
|
140
135
|
|
|
@@ -143,7 +138,7 @@ describe "Controller render" do
|
|
|
143
138
|
|
|
144
139
|
it "should handle serialization obj ('xml', 'json')" do
|
|
145
140
|
class ::SpecialFormatSpec
|
|
146
|
-
inherit
|
|
141
|
+
inherit Rad::Controller::Abstract
|
|
147
142
|
|
|
148
143
|
def json_action
|
|
149
144
|
render json: {a: "b"}
|
|
@@ -163,7 +158,7 @@ describe "Controller render" do
|
|
|
163
158
|
|
|
164
159
|
it "should render another action via action: :action_name" do
|
|
165
160
|
class ::AnotherActionSpec
|
|
166
|
-
inherit
|
|
161
|
+
inherit Rad::Controller::Abstract
|
|
167
162
|
|
|
168
163
|
def another_action; end
|
|
169
164
|
|
|
@@ -177,7 +172,7 @@ describe "Controller render" do
|
|
|
177
172
|
|
|
178
173
|
it "should take :inline option" do
|
|
179
174
|
class ::InlineRenderSpec
|
|
180
|
-
inherit
|
|
175
|
+
inherit Rad::Controller::Abstract
|
|
181
176
|
|
|
182
177
|
def action
|
|
183
178
|
render inline: "content"
|
|
@@ -189,7 +184,7 @@ describe "Controller render" do
|
|
|
189
184
|
|
|
190
185
|
it ":inline option should render without layout" do
|
|
191
186
|
class ::InlineWithLayoutSpec
|
|
192
|
-
inherit
|
|
187
|
+
inherit Rad::Controller::Abstract
|
|
193
188
|
|
|
194
189
|
layout '/layouts/app'
|
|
195
190
|
|
|
@@ -203,7 +198,7 @@ describe "Controller render" do
|
|
|
203
198
|
|
|
204
199
|
it "should render correct action inside of special 'actions.xxx' template file" do
|
|
205
200
|
class ::MultipleActions
|
|
206
|
-
inherit
|
|
201
|
+
inherit Rad::Controller::Abstract
|
|
207
202
|
|
|
208
203
|
def increase; end
|
|
209
204
|
def decrease; end
|
|
@@ -212,6 +207,21 @@ describe "Controller render" do
|
|
|
212
207
|
|
|
213
208
|
ccall(MultipleActions, :increase).should == "plus\n"
|
|
214
209
|
ccall(MultipleActions, :decrease).should == "minus\n"
|
|
215
|
-
ccall(MultipleActions, :action_without_template).should ==
|
|
210
|
+
ccall(MultipleActions, :action_without_template).should == ''
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
it "relative templates should be searched as: CurrentClass -> SuperClass -> SameDir" do
|
|
214
|
+
module ::RelativeSpec
|
|
215
|
+
class A
|
|
216
|
+
inherit Rad::Controller::Abstract
|
|
217
|
+
|
|
218
|
+
def show; end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
class B < A
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
ccall(RelativeSpec::B, :show).should == 'form b'
|
|
216
226
|
end
|
|
217
227
|
end
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
-
require "
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
describe "Conveyor" do
|
|
4
4
|
inject conveyors: :conveyors
|
|
5
5
|
|
|
6
|
-
with_environment environment: :development
|
|
7
|
-
|
|
8
6
|
def call_conveyor
|
|
9
7
|
r = conveyors.web.call(result: [])
|
|
10
8
|
r.result
|
|
11
9
|
end
|
|
12
10
|
|
|
11
|
+
after :all do
|
|
12
|
+
remove_constants %w(
|
|
13
|
+
SmokeTestASpec
|
|
14
|
+
SmokeTestBSpec
|
|
15
|
+
CommonCaseASpec
|
|
16
|
+
CommonCaseBSpec
|
|
17
|
+
NotCatchedErrorSpec
|
|
18
|
+
ErrorInAfterBlockASpec
|
|
19
|
+
ErrorInAfterBlockBSpec
|
|
20
|
+
ErrorBubblingASpec
|
|
21
|
+
ErrorBubblingBSpec
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
isolate :conveyors
|
|
26
|
+
|
|
27
|
+
before :all do
|
|
28
|
+
rad.mode = :development, true
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
after :all do
|
|
32
|
+
rad.mode = :test, true
|
|
33
|
+
end
|
|
34
|
+
|
|
13
35
|
it "smoke test" do
|
|
14
|
-
class SmokeTestASpec < Rad::Processor
|
|
36
|
+
class SmokeTestASpec < Rad::Conveyors::Processor
|
|
15
37
|
def call
|
|
16
38
|
workspace.result << :a_before
|
|
17
39
|
next_processor.call
|
|
@@ -19,11 +41,11 @@ describe "Conveyor" do
|
|
|
19
41
|
end
|
|
20
42
|
end
|
|
21
43
|
|
|
22
|
-
class SmokeTestBSpec < Rad::Processor
|
|
44
|
+
class SmokeTestBSpec < Rad::Conveyors::Processor
|
|
23
45
|
def call
|
|
24
|
-
rad
|
|
46
|
+
rad.workspace.result << :b_before
|
|
25
47
|
next_processor.call
|
|
26
|
-
rad
|
|
48
|
+
rad.workspace.result << :b_after
|
|
27
49
|
end
|
|
28
50
|
end
|
|
29
51
|
|
|
@@ -34,7 +56,7 @@ describe "Conveyor" do
|
|
|
34
56
|
|
|
35
57
|
describe "error handling" do
|
|
36
58
|
it "common case" do
|
|
37
|
-
class CommonCaseASpec < Rad::Processor
|
|
59
|
+
class CommonCaseASpec < Rad::Conveyors::Processor
|
|
38
60
|
def call
|
|
39
61
|
workspace.result << :a_before
|
|
40
62
|
|
|
@@ -46,7 +68,7 @@ describe "Conveyor" do
|
|
|
46
68
|
end
|
|
47
69
|
end
|
|
48
70
|
|
|
49
|
-
class CommonCaseBSpec < Rad::Processor
|
|
71
|
+
class CommonCaseBSpec < Rad::Conveyors::Processor
|
|
50
72
|
def call
|
|
51
73
|
workspace.result << :b_before
|
|
52
74
|
raise 'error before'
|
|
@@ -59,7 +81,7 @@ describe "Conveyor" do
|
|
|
59
81
|
end
|
|
60
82
|
|
|
61
83
|
it "should raise error if not catched" do
|
|
62
|
-
class NotCatchedErrorSpec < Rad::Processor
|
|
84
|
+
class NotCatchedErrorSpec < Rad::Conveyors::Processor
|
|
63
85
|
def call
|
|
64
86
|
workspace.result << :before
|
|
65
87
|
raise 'error before'
|
|
@@ -71,7 +93,7 @@ describe "Conveyor" do
|
|
|
71
93
|
end
|
|
72
94
|
|
|
73
95
|
it "in after block" do
|
|
74
|
-
class ErrorInAfterBlockASpec < Rad::Processor
|
|
96
|
+
class ErrorInAfterBlockASpec < Rad::Conveyors::Processor
|
|
75
97
|
def call
|
|
76
98
|
workspace.result << :a_before
|
|
77
99
|
|
|
@@ -84,7 +106,7 @@ describe "Conveyor" do
|
|
|
84
106
|
end
|
|
85
107
|
|
|
86
108
|
|
|
87
|
-
class ErrorInAfterBlockBSpec < Rad::Processor
|
|
109
|
+
class ErrorInAfterBlockBSpec < Rad::Conveyors::Processor
|
|
88
110
|
def call
|
|
89
111
|
workspace.result << :b_before
|
|
90
112
|
next_processor.call
|
|
@@ -99,7 +121,7 @@ describe "Conveyor" do
|
|
|
99
121
|
end
|
|
100
122
|
|
|
101
123
|
it "bubbling (from error)" do
|
|
102
|
-
class ErrorBubblingASpec < Rad::Processor
|
|
124
|
+
class ErrorBubblingASpec < Rad::Conveyors::Processor
|
|
103
125
|
def call
|
|
104
126
|
begin
|
|
105
127
|
next_processor.call
|
|
@@ -109,7 +131,7 @@ describe "Conveyor" do
|
|
|
109
131
|
end
|
|
110
132
|
end
|
|
111
133
|
|
|
112
|
-
class ErrorBubblingBSpec < Rad::Processor
|
|
134
|
+
class ErrorBubblingBSpec < Rad::Conveyors::Processor
|
|
113
135
|
def call
|
|
114
136
|
raise 'error'
|
|
115
137
|
end
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
require '
|
|
1
|
+
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
require 'rad
|
|
3
|
+
require 'rad'
|
|
4
4
|
require 'rad/spec/environment'
|
|
5
5
|
|
|
6
|
-
describe '
|
|
7
|
-
before
|
|
8
|
-
|
|
9
|
-
@c
|
|
10
|
-
@c.key = 'value'
|
|
11
|
-
@c.key2 = 'value2'
|
|
6
|
+
describe 'Config' do
|
|
7
|
+
before do
|
|
8
|
+
rad.mode = :development, true
|
|
9
|
+
@c = Rad::Config.new key: 'value', key2: 'value2'
|
|
12
10
|
end
|
|
11
|
+
after{rad.mode = :test, true}
|
|
13
12
|
|
|
14
|
-
it "
|
|
15
|
-
|
|
13
|
+
it "clone" do
|
|
14
|
+
c = Rad::Config.new a: {b: :c}
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "should merge hashes (with the following order: config.default <= config <= config.environment)" do
|
|
23
|
-
@c.merge_config! "#{spec_dir}/config.yml"
|
|
16
|
+
c2 = c.clone
|
|
17
|
+
c.a.delete :b
|
|
18
|
+
c.delete :a
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
@c.user_service.key("invalid").should == 'value'
|
|
27
|
-
@c.user_service.test_key("invalid").should == 'test_value'
|
|
28
|
-
@c.user_service.name.should == 'test_name'
|
|
20
|
+
c2.a[:b].should == :c
|
|
29
21
|
end
|
|
30
22
|
end
|