docks_app 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.editorconfig +8 -0
- data/.gitignore +22 -0
- data/.rubocop.yml +20 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +3 -0
- data/bin/docks +5 -0
- data/config/json/docks_config.json +71 -0
- data/config/ruby/docks_config.rb +127 -0
- data/config/yaml/docks_config.yml +70 -0
- data/docks.gemspec +38 -0
- data/lib/docks/build.rb +300 -0
- data/lib/docks/cache.rb +143 -0
- data/lib/docks/command_line.rb +65 -0
- data/lib/docks/configuration.rb +217 -0
- data/lib/docks/containers/base_container.rb +103 -0
- data/lib/docks/containers/class_container.rb +39 -0
- data/lib/docks/containers/component_container.rb +92 -0
- data/lib/docks/containers/demo_container.rb +105 -0
- data/lib/docks/containers/factory_container.rb +12 -0
- data/lib/docks/containers/function_container.rb +46 -0
- data/lib/docks/containers/mixin_container.rb +19 -0
- data/lib/docks/containers/pattern_container.rb +168 -0
- data/lib/docks/containers/pattern_library_container.rb +77 -0
- data/lib/docks/containers/state_container.rb +9 -0
- data/lib/docks/containers/symbol_container.rb +77 -0
- data/lib/docks/containers/variable_container.rb +47 -0
- data/lib/docks/containers/variant_container.rb +9 -0
- data/lib/docks/containers/variation_container.rb +38 -0
- data/lib/docks/containers.rb +25 -0
- data/lib/docks/descriptor.rb +60 -0
- data/lib/docks/errors.rb +5 -0
- data/lib/docks/group.rb +66 -0
- data/lib/docks/helpers/github_helper.rb +29 -0
- data/lib/docks/helpers/path_helper.rb +94 -0
- data/lib/docks/helpers/render_helper.rb +87 -0
- data/lib/docks/helpers.rb +19 -0
- data/lib/docks/languages/base_language.rb +17 -0
- data/lib/docks/languages/coffeescript_language.rb +30 -0
- data/lib/docks/languages/common_types/markup_language.rb +71 -0
- data/lib/docks/languages/css_language.rb +13 -0
- data/lib/docks/languages/erb_language.rb +21 -0
- data/lib/docks/languages/haml_language.rb +21 -0
- data/lib/docks/languages/html_language.rb +10 -0
- data/lib/docks/languages/javascript_language.rb +42 -0
- data/lib/docks/languages/json_language.rb +18 -0
- data/lib/docks/languages/less_language.rb +33 -0
- data/lib/docks/languages/markdown_language.rb +10 -0
- data/lib/docks/languages/sass_language.rb +36 -0
- data/lib/docks/languages/slim_language.rb +21 -0
- data/lib/docks/languages/stylus_language.rb +26 -0
- data/lib/docks/languages/yaml_language.rb +18 -0
- data/lib/docks/languages.rb +103 -0
- data/lib/docks/markdown.rb +18 -0
- data/lib/docks/messenger.rb +69 -0
- data/lib/docks/naming_conventions/base_naming_convention.rb +9 -0
- data/lib/docks/naming_conventions/bem_naming_convention.rb +45 -0
- data/lib/docks/naming_conventions/suit_naming_convention.rb +45 -0
- data/lib/docks/naming_conventions.rb +21 -0
- data/lib/docks/ostruct.rb +17 -0
- data/lib/docks/parser.rb +86 -0
- data/lib/docks/parsers/base_parser.rb +128 -0
- data/lib/docks/parsers/coffeescript_parser.rb +30 -0
- data/lib/docks/parsers/css_parser.rb +27 -0
- data/lib/docks/parsers/javascript_parser.rb +30 -0
- data/lib/docks/parsers/less_parser.rb +22 -0
- data/lib/docks/parsers/sass_parser.rb +31 -0
- data/lib/docks/parsers/stylus_parser.rb +28 -0
- data/lib/docks/process.rb +60 -0
- data/lib/docks/processors.rb +416 -0
- data/lib/docks/renderers/base_renderer.rb +64 -0
- data/lib/docks/renderers/common_features/capturable.rb +69 -0
- data/lib/docks/renderers/common_features/helperable.rb +23 -0
- data/lib/docks/renderers/erb_renderer.rb +68 -0
- data/lib/docks/renderers/haml_renderer.rb +37 -0
- data/lib/docks/renderers/slim_renderer.rb +33 -0
- data/lib/docks/symbol_sources/base_symbol_source.rb +12 -0
- data/lib/docks/symbol_sources/jquery_symbol_source.rb +17 -0
- data/lib/docks/symbol_sources/mdn_symbol_source.rb +35 -0
- data/lib/docks/symbol_sources/sass_symbol_source.rb +27 -0
- data/lib/docks/symbol_sources.rb +28 -0
- data/lib/docks/tags/access_tag.rb +27 -0
- data/lib/docks/tags/activate_with_tag.rb +17 -0
- data/lib/docks/tags/active_tag.rb +14 -0
- data/lib/docks/tags/alias_tag.rb +17 -0
- data/lib/docks/tags/author_tag.rb +19 -0
- data/lib/docks/tags/base_tag.rb +52 -0
- data/lib/docks/tags/beta_tag.rb +26 -0
- data/lib/docks/tags/class_tag.rb +16 -0
- data/lib/docks/tags/compatibility_tag.rb +19 -0
- data/lib/docks/tags/demo_type_tag.rb +14 -0
- data/lib/docks/tags/deprecated_tag.rb +26 -0
- data/lib/docks/tags/description_tag.rb +99 -0
- data/lib/docks/tags/example_tag.rb +20 -0
- data/lib/docks/tags/factory_tag.rb +16 -0
- data/lib/docks/tags/for_tag.rb +23 -0
- data/lib/docks/tags/group_tag.rb +10 -0
- data/lib/docks/tags/helper_tag.rb +13 -0
- data/lib/docks/tags/include_with_tag.rb +57 -0
- data/lib/docks/tags/javascript_action_tag.rb +10 -0
- data/lib/docks/tags/link_tag.rb +18 -0
- data/lib/docks/tags/markup_tag.rb +106 -0
- data/lib/docks/tags/member_tag.rb +37 -0
- data/lib/docks/tags/method_tag.rb +18 -0
- data/lib/docks/tags/name_tag.rb +10 -0
- data/lib/docks/tags/object_tag.rb +15 -0
- data/lib/docks/tags/param_tag.rb +94 -0
- data/lib/docks/tags/pattern_tag.rb +21 -0
- data/lib/docks/tags/preclude_tag.rb +17 -0
- data/lib/docks/tags/private_tag.rb +15 -0
- data/lib/docks/tags/property_tag.rb +18 -0
- data/lib/docks/tags/public_tag.rb +15 -0
- data/lib/docks/tags/require_tag.rb +47 -0
- data/lib/docks/tags/returns_tag.rb +31 -0
- data/lib/docks/tags/set_by_tag.rb +18 -0
- data/lib/docks/tags/signature_tag.rb +35 -0
- data/lib/docks/tags/since_tag.rb +26 -0
- data/lib/docks/tags/source_tag.rb +12 -0
- data/lib/docks/tags/state_tag.rb +21 -0
- data/lib/docks/tags/static_tag.rb +14 -0
- data/lib/docks/tags/subcomponent_tag.rb +68 -0
- data/lib/docks/tags/subtitle_tag.rb +11 -0
- data/lib/docks/tags/symbol_type_tag.rb +10 -0
- data/lib/docks/tags/throws_tag.rb +30 -0
- data/lib/docks/tags/title_tag.rb +10 -0
- data/lib/docks/tags/type_tag.rb +10 -0
- data/lib/docks/tags/value_tag.rb +10 -0
- data/lib/docks/tags/variant_tag.rb +21 -0
- data/lib/docks/tags/variation_tag.rb +136 -0
- data/lib/docks/tags.rb +103 -0
- data/lib/docks/templates.rb +122 -0
- data/lib/docks/themes.rb +19 -0
- data/lib/docks/types.rb +26 -0
- data/lib/docks/version.rb +3 -0
- data/lib/docks.rb +37 -0
- data/spec/fixtures/build/scripts/bar/bar_2.js +1 -0
- data/spec/fixtures/build/scripts/bar.js +1 -0
- data/spec/fixtures/build/styles/foo/foo-2.css +1 -0
- data/spec/fixtures/build/styles/foo.css +1 -0
- data/spec/fixtures/build/templates/baz/baz_2.erb +1 -0
- data/spec/fixtures/build/templates/baz.erb +1 -0
- data/spec/fixtures/grouper/components/button/button.coffee +0 -0
- data/spec/fixtures/grouper/components/button/button.haml +0 -0
- data/spec/fixtures/grouper/components/button/button.scss +0 -0
- data/spec/fixtures/grouper/components/checkbox/_checkbox.haml +0 -0
- data/spec/fixtures/grouper/components/checkbox/_checkbox.scss +0 -0
- data/spec/fixtures/grouper/components/checkbox/checkbox.coffee +0 -0
- data/spec/fixtures/grouper/components/form/form.coffee +0 -0
- data/spec/fixtures/grouper/components/form/form.m +0 -0
- data/spec/fixtures/grouper/components/form/form.scss +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/_next-expanding-textarea.scss +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/_next_expanding_textarea.coffee +0 -0
- data/spec/fixtures/grouper/components/next-expanding-textarea/next-expanding-textarea.haml +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.coffee +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.haml +0 -0
- data/spec/fixtures/grouper/components/next-tab/next-tab.scss +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.coffee +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.haml +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.min.html +0 -0
- data/spec/fixtures/grouper/components/segmented control/segmented control.scss +0 -0
- data/spec/fixtures/grouper/markup/list-view.haml +0 -0
- data/spec/fixtures/grouper/markup/resizable/resizable.haml +0 -0
- data/spec/fixtures/grouper/markup/toggle.haml +0 -0
- data/spec/fixtures/grouper/scripts/resizable/resizable.coffee +0 -0
- data/spec/fixtures/grouper/scripts/toggle.coffee +0 -0
- data/spec/fixtures/grouper/style/_list-view.scss +0 -0
- data/spec/fixtures/grouper/style/_toggle.scss +0 -0
- data/spec/fixtures/languages/stub.json +3 -0
- data/spec/fixtures/languages/stub.yml +2 -0
- data/spec/fixtures/parsers/coffeescript_parser_fixture_basic.coffee +20 -0
- data/spec/fixtures/parsers/coffeescript_parser_fixture_complex.coffee +80 -0
- data/spec/fixtures/parsers/css_parser_fixture_basic.css +44 -0
- data/spec/fixtures/parsers/css_parser_fixture_complex.css +120 -0
- data/spec/fixtures/parsers/javascript_parser_fixture_basic.js +27 -0
- data/spec/fixtures/parsers/javascript_parser_fixture_complex.js +85 -0
- data/spec/fixtures/parsers/sass_parser_fixture_basic.scss +39 -0
- data/spec/fixtures/parsers/sass_parser_fixture_complex.scss +149 -0
- data/spec/fixtures/parsers/stylus_parser_fixture_basic.styl +34 -0
- data/spec/fixtures/parsers/stylus_parser_fixture_complex.styl +113 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/code_blocks.txt +10 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/headings.txt +15 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/lists.txt +21 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/lists_with_nesting.txt +13 -0
- data/spec/fixtures/processors/join_with_smart_line_breaks/multiple_paragraphs.txt +11 -0
- data/spec/fixtures/renderers/helpers.rb +37 -0
- data/spec/fixtures/renderers/html_output.html +7 -0
- data/spec/fixtures/renderers/templates/layouts/application.html.erb +0 -0
- data/spec/fixtures/renderers/templates/layouts/more/subdirectory.html.erb +0 -0
- data/spec/fixtures/renderers/templates/partials/_leading_underscore.html.erb +1 -0
- data/spec/fixtures/renderers/templates/partials/more/_subdirectory.html.erb +1 -0
- data/spec/fixtures/renderers/templates/partials/partial.html.erb +0 -0
- data/spec/fixtures/renderers/templates/partials/template.html.erb +1 -0
- data/spec/fixtures/renderers/templates/template.html.erb +1 -0
- data/spec/fixtures/tags/description/button.md +24 -0
- data/spec/fixtures/tags/description/class.md +27 -0
- data/spec/fixtures/tags/description/component.md +23 -0
- data/spec/fixtures/tags/description/function.md +30 -0
- data/spec/lib/build_spec.rb +467 -0
- data/spec/lib/cache_spec.rb +175 -0
- data/spec/lib/command_line_spec.rb +77 -0
- data/spec/lib/configuration_spec.rb +180 -0
- data/spec/lib/containers/base_container_spec.rb +214 -0
- data/spec/lib/containers/class_container_spec.rb +209 -0
- data/spec/lib/containers/component_container_spec.rb +158 -0
- data/spec/lib/containers/demo_container_spec.rb +113 -0
- data/spec/lib/containers/function_container_spec.rb +116 -0
- data/spec/lib/containers/mixin_container_spec.rb +4 -0
- data/spec/lib/containers/pattern_container_spec.rb +291 -0
- data/spec/lib/containers/pattern_library_container_spec.rb +130 -0
- data/spec/lib/containers/symbol_container_spec.rb +216 -0
- data/spec/lib/containers/variable_container_spec.rb +116 -0
- data/spec/lib/containers/variation_container_spec.rb +52 -0
- data/spec/lib/containers_spec.rb +22 -0
- data/spec/lib/descriptor_spec.rb +73 -0
- data/spec/lib/group_spec.rb +151 -0
- data/spec/lib/helpers/path_helper_spec.rb +202 -0
- data/spec/lib/helpers/render_helper_spec.rb +159 -0
- data/spec/lib/helpers_spec.rb +35 -0
- data/spec/lib/languages/base_language_spec.rb +32 -0
- data/spec/lib/languages/coffeescript_language_spec.rb +52 -0
- data/spec/lib/languages/css_language_spec.rb +13 -0
- data/spec/lib/languages/erb_language_spec.rb +33 -0
- data/spec/lib/languages/haml_language_spec.rb +32 -0
- data/spec/lib/languages/javascript_language_spec.rb +54 -0
- data/spec/lib/languages/json_language_spec.rb +24 -0
- data/spec/lib/languages/less_language_spec.rb +39 -0
- data/spec/lib/languages/markup_language_spec.rb +95 -0
- data/spec/lib/languages/sass_language_spec.rb +53 -0
- data/spec/lib/languages/slim_language_spec.rb +32 -0
- data/spec/lib/languages/stylus_language_spec.rb +34 -0
- data/spec/lib/languages/yaml_language_spec.rb +24 -0
- data/spec/lib/languages_spec.rb +127 -0
- data/spec/lib/markdown_spec.rb +63 -0
- data/spec/lib/messenger_spec.rb +1 -0
- data/spec/lib/naming_conventions/bem_naming_convention_spec.rb +112 -0
- data/spec/lib/naming_conventions/suit_naming_convention_spec.rb +107 -0
- data/spec/lib/naming_conventions_spec.rb +28 -0
- data/spec/lib/ostruct_spec.rb +15 -0
- data/spec/lib/parser_spec.rb +93 -0
- data/spec/lib/parsers/base_parser_spec.rb +128 -0
- data/spec/lib/parsers/coffeescript_parser_spec.rb +184 -0
- data/spec/lib/parsers/css_parser_spec.rb +136 -0
- data/spec/lib/parsers/javascript_parser_spec.rb +216 -0
- data/spec/lib/parsers/less_parser_spec.rb +111 -0
- data/spec/lib/parsers/sass_parser_spec.rb +233 -0
- data/spec/lib/parsers/stylus_parser_spec.rb +212 -0
- data/spec/lib/process_spec.rb +96 -0
- data/spec/lib/processors_spec.rb +555 -0
- data/spec/lib/renderers/base_renderer_spec.rb +122 -0
- data/spec/lib/renderers/common_features/helperable_spec.rb +30 -0
- data/spec/lib/renderers/erb_renderer_spec.rb +119 -0
- data/spec/lib/renderers/haml_renderer_spec.rb +103 -0
- data/spec/lib/renderers/slim_renderer_spec.rb +103 -0
- data/spec/lib/symbol_sources/jquery_symbol_source_spec.rb +25 -0
- data/spec/lib/symbol_sources/mdn_symbol_source_spec.rb +40 -0
- data/spec/lib/symbol_sources/sass_symbol_source_spec.rb +39 -0
- data/spec/lib/symbol_sources_spec.rb +19 -0
- data/spec/lib/tags/access_tag_spec.rb +32 -0
- data/spec/lib/tags/activate_with_tag_spec.rb +31 -0
- data/spec/lib/tags/active_tag_spec.rb +24 -0
- data/spec/lib/tags/alias_tag_spec.rb +31 -0
- data/spec/lib/tags/author_tag_spec.rb +172 -0
- data/spec/lib/tags/base_tag_spec.rb +21 -0
- data/spec/lib/tags/beta_tag_spec.rb +52 -0
- data/spec/lib/tags/class_tag_spec.rb +29 -0
- data/spec/lib/tags/compatibility_tag_spec.rb +159 -0
- data/spec/lib/tags/demo_type_tag_spec.rb +24 -0
- data/spec/lib/tags/deprecated_tag_spec.rb +50 -0
- data/spec/lib/tags/description_tag_spec.rb +242 -0
- data/spec/lib/tags/example_tag_spec.rb +37 -0
- data/spec/lib/tags/factory_tag_spec.rb +29 -0
- data/spec/lib/tags/for_tag_spec.rb +45 -0
- data/spec/lib/tags/group_tag_spec.rb +20 -0
- data/spec/lib/tags/helper_tag_spec.rb +22 -0
- data/spec/lib/tags/include_with_tag_spec.rb +74 -0
- data/spec/lib/tags/javascript_action_tag_spec.rb +20 -0
- data/spec/lib/tags/link_tag_spec.rb +49 -0
- data/spec/lib/tags/markup_tag_spec.rb +255 -0
- data/spec/lib/tags/member_tag_spec.rb +167 -0
- data/spec/lib/tags/method_tag_spec.rb +27 -0
- data/spec/lib/tags/name_tag_spec.rb +20 -0
- data/spec/lib/tags/object_tag_spec.rb +24 -0
- data/spec/lib/tags/param_tag_spec.rb +261 -0
- data/spec/lib/tags/pattern_tag_spec.rb +49 -0
- data/spec/lib/tags/preclude_tag_spec.rb +31 -0
- data/spec/lib/tags/private_tag_spec.rb +31 -0
- data/spec/lib/tags/property_tag_spec.rb +27 -0
- data/spec/lib/tags/public_tag_spec.rb +29 -0
- data/spec/lib/tags/require_tag_spec.rb +133 -0
- data/spec/lib/tags/returns_tag_spec.rb +85 -0
- data/spec/lib/tags/set_by_tag_spec.rb +92 -0
- data/spec/lib/tags/signature_tag_spec.rb +125 -0
- data/spec/lib/tags/since_tag_spec.rb +48 -0
- data/spec/lib/tags/state_tag_spec.rb +199 -0
- data/spec/lib/tags/static_tag_spec.rb +27 -0
- data/spec/lib/tags/subcomponent_tag_spec.rb +78 -0
- data/spec/lib/tags/subtitle_tag_spec.rb +13 -0
- data/spec/lib/tags/symbol_type_tag_spec.rb +20 -0
- data/spec/lib/tags/throws_tag_spec.rb +49 -0
- data/spec/lib/tags/title_tag_spec.rb +20 -0
- data/spec/lib/tags/type_tag_spec.rb +20 -0
- data/spec/lib/tags/value_tag_spec.rb +20 -0
- data/spec/lib/tags/variant_tag_spec.rb +13 -0
- data/spec/lib/tags/variation_tag_spec.rb +154 -0
- data/spec/lib/tags_spec.rb +264 -0
- data/spec/lib/templates_spec.rb +185 -0
- data/spec/lib/themes_spec.rb +32 -0
- data/spec/spec_helper.rb +34 -0
- data/tasks/rspec.rake +7 -0
- data/tasks/rubocop.rake +8 -0
- metadata +740 -0
@@ -0,0 +1,261 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Param do
|
4
|
+
subject { Docks::Tags::Param.instance }
|
5
|
+
|
6
|
+
it "allows multiline content" do
|
7
|
+
expect(subject.multiline?).to be true
|
8
|
+
end
|
9
|
+
|
10
|
+
it "allows multiple tags per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be true
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
let(:symbol) { Docks::Containers::Symbol.new }
|
16
|
+
let(:name) { "_tab_list2" }
|
17
|
+
let(:types) { "Array | DOMElement" }
|
18
|
+
let(:processed_types) { Docks::Processors.split_types(types) }
|
19
|
+
let(:default) { "[]" }
|
20
|
+
let(:description) { "The list of tabs." }
|
21
|
+
|
22
|
+
it "creates the param when only the name is provided" do
|
23
|
+
result = process_param_with([name]).first
|
24
|
+
expect(result.name).to eq name
|
25
|
+
expect(result.multiple).to be false
|
26
|
+
end
|
27
|
+
|
28
|
+
it "creates the param when special characters exist in the name" do
|
29
|
+
result = process_param_with(["_with_underscore"]).first
|
30
|
+
expect(result.name).to eq "_with_underscore"
|
31
|
+
|
32
|
+
result = process_param_with(["$$with-dollars"]).first
|
33
|
+
expect(result.name).to eq "$$with-dollars"
|
34
|
+
end
|
35
|
+
|
36
|
+
context "when this param represents multiple params" do
|
37
|
+
it "is not multiple when no spread operator is used" do
|
38
|
+
result = process_param_with([name]).first
|
39
|
+
expect(result.name).to eq name
|
40
|
+
expect(result.multiple).to be false
|
41
|
+
end
|
42
|
+
|
43
|
+
it "indicates that the param is a multiple param when the spread operator is used" do
|
44
|
+
result = process_param_with(["...#{name}"]).first
|
45
|
+
expect(result.name).to eq name
|
46
|
+
expect(result.multiple).to be true
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context "when types provided" do
|
51
|
+
it "creates the param when the name and types are provided" do
|
52
|
+
result = process_param_with(["{#{types}} #{name}"]).first
|
53
|
+
expect(result.name).to eq name
|
54
|
+
expect(result.types).to eq processed_types
|
55
|
+
end
|
56
|
+
|
57
|
+
it "sets the types to an empty array when not provided" do
|
58
|
+
result = process_param_with([name]).first
|
59
|
+
expect(result.name).to eq name
|
60
|
+
expect(result.types).to eq Array.new
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context "when optional" do
|
65
|
+
it "creates the param with an optional attribute" do
|
66
|
+
result = process_param_with(["[#{name}]"]).first
|
67
|
+
expect(result.name).to eq name
|
68
|
+
expect(result.optional).to be true
|
69
|
+
expect(result.default).to be nil
|
70
|
+
end
|
71
|
+
|
72
|
+
it "creates the param with an optional attribute and the actual default value" do
|
73
|
+
result = process_param_with(["[#{name} = #{default}]"]).first
|
74
|
+
expect(result.name).to eq name
|
75
|
+
expect(result.optional).to be true
|
76
|
+
expect(result.default).to eq default
|
77
|
+
end
|
78
|
+
|
79
|
+
it "sets optional and default to the appropriate values when not provided" do
|
80
|
+
result = process_param_with([name]).first
|
81
|
+
expect(result.name).to eq name
|
82
|
+
expect(result.optional).to be false
|
83
|
+
expect(result.default).to be nil
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context "when description provided" do
|
88
|
+
it "creates the param when the name and description are provided" do
|
89
|
+
result = process_param_with(["#{name} #{description}"]).first
|
90
|
+
expect(result.name).to eq name
|
91
|
+
expect(result.description).to eq description
|
92
|
+
|
93
|
+
result = process_param_with(["#{name} - #{description}"]).first
|
94
|
+
expect(result.name).to eq name
|
95
|
+
expect(result.description).to eq description
|
96
|
+
end
|
97
|
+
|
98
|
+
it "sets description to be nil when not provided" do
|
99
|
+
result = process_param_with([name]).first
|
100
|
+
expect(result.name).to eq name
|
101
|
+
expect(result.description).to be nil
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context "when there are combinations of the components" do
|
106
|
+
it "processes lines with a name, default, and types" do
|
107
|
+
result = process_param_with(["{#{types}} [#{name} =#{default}]"]).first
|
108
|
+
expect(result.name).to eq name
|
109
|
+
expect(result.types).to eq processed_types
|
110
|
+
expect(result.optional).to be true
|
111
|
+
expect(result.default).to eq default
|
112
|
+
expect(result.description).to be nil
|
113
|
+
end
|
114
|
+
|
115
|
+
it "processes lines with a name, types, and description" do
|
116
|
+
result = process_param_with(["{#{types}} #{name} -#{description}"]).first
|
117
|
+
expect(result.name).to eq name
|
118
|
+
expect(result.types).to eq processed_types
|
119
|
+
expect(result.optional).to be false
|
120
|
+
expect(result.default).to be nil
|
121
|
+
expect(result.description).to eq description
|
122
|
+
|
123
|
+
result = process_param_with(["{#{types}} #{name} #{description}"]).first
|
124
|
+
expect(result.name).to eq name
|
125
|
+
expect(result.types).to eq processed_types
|
126
|
+
expect(result.optional).to be false
|
127
|
+
expect(result.default).to be nil
|
128
|
+
expect(result.description).to eq description
|
129
|
+
end
|
130
|
+
|
131
|
+
it "processes lines with a name, optional, and description" do
|
132
|
+
result = process_param_with(["[#{name}] #{description}"]).first
|
133
|
+
expect(result.name).to eq name
|
134
|
+
expect(result.types).to eq Array.new
|
135
|
+
expect(result.optional).to be true
|
136
|
+
expect(result.default).to be nil
|
137
|
+
expect(result.description).to eq description
|
138
|
+
|
139
|
+
result = process_param_with(["[#{name}] - #{description}"]).first
|
140
|
+
expect(result.name).to eq name
|
141
|
+
expect(result.types).to eq Array.new
|
142
|
+
expect(result.optional).to be true
|
143
|
+
expect(result.default).to be nil
|
144
|
+
expect(result.description).to eq description
|
145
|
+
end
|
146
|
+
|
147
|
+
it "processes lines with a name, default value, and description" do
|
148
|
+
result = process_param_with(["[#{name}= #{default}] #{description}"]).first
|
149
|
+
expect(result.name).to eq name
|
150
|
+
expect(result.types).to eq Array.new
|
151
|
+
expect(result.optional).to be true
|
152
|
+
expect(result.default).to eq default
|
153
|
+
expect(result.description).to eq description
|
154
|
+
|
155
|
+
result = process_param_with(["[#{name} = #{default}] -#{description}"]).first
|
156
|
+
expect(result.name).to eq name
|
157
|
+
expect(result.types).to eq Array.new
|
158
|
+
expect(result.optional).to be true
|
159
|
+
expect(result.default).to eq default
|
160
|
+
expect(result.description).to eq description
|
161
|
+
end
|
162
|
+
|
163
|
+
it "processes lines with a name, types, spread param, and description" do
|
164
|
+
result = process_param_with(["{#{types}} ...#{name} #{description}"]).first
|
165
|
+
expect(result.name).to eq name
|
166
|
+
expect(result.types).to eq processed_types
|
167
|
+
expect(result.optional).to be false
|
168
|
+
expect(result.multiple).to be true
|
169
|
+
expect(result.default).to be nil
|
170
|
+
expect(result.description).to eq description
|
171
|
+
|
172
|
+
result = process_param_with([" {#{types}} ...#{name} -#{description}"]).first
|
173
|
+
expect(result.name).to eq name
|
174
|
+
expect(result.types).to eq processed_types
|
175
|
+
expect(result.optional).to be false
|
176
|
+
expect(result.multiple).to be true
|
177
|
+
expect(result.default).to be nil
|
178
|
+
expect(result.description).to eq description
|
179
|
+
end
|
180
|
+
|
181
|
+
it "processes lines with a name, types, spread param, default value, and description" do
|
182
|
+
result = process_param_with(["{#{types}} [...#{name}= #{default}] #{description}"]).first
|
183
|
+
expect(result.name).to eq name
|
184
|
+
expect(result.types).to eq processed_types
|
185
|
+
expect(result.optional).to be true
|
186
|
+
expect(result.multiple).to be true
|
187
|
+
expect(result.default).to eq default
|
188
|
+
expect(result.description).to eq description
|
189
|
+
|
190
|
+
result = process_param_with([" {#{types}} [...#{name} = #{default}] -#{description}"]).first
|
191
|
+
expect(result.name).to eq name
|
192
|
+
expect(result.types).to eq processed_types
|
193
|
+
expect(result.optional).to be true
|
194
|
+
expect(result.multiple).to be true
|
195
|
+
expect(result.default).to eq default
|
196
|
+
expect(result.description).to eq description
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
context "when there are properties" do
|
201
|
+
let(:base_param) { "foo" }
|
202
|
+
let(:prop_one) { "{String} foo.bar" }
|
203
|
+
let(:prop_two) { "{Number} foo['baz']" }
|
204
|
+
let(:prop_three) { "{String} foo[].qux" }
|
205
|
+
let(:unrelated) { "qux" }
|
206
|
+
|
207
|
+
it "joins a property using dot syntax" do
|
208
|
+
params = process_param_with [base_param, prop_one]
|
209
|
+
param = params.first
|
210
|
+
expect(params.length).to be 1
|
211
|
+
expect(param.name).to eq base_param
|
212
|
+
expect(param.properties.length).to be 1
|
213
|
+
expect(param.properties.first.name).to eq "bar"
|
214
|
+
end
|
215
|
+
|
216
|
+
it "joins a property using bracket syntax" do
|
217
|
+
params = process_param_with [base_param, prop_two]
|
218
|
+
param = params.first
|
219
|
+
expect(params.length).to be 1
|
220
|
+
expect(param.name).to eq base_param
|
221
|
+
expect(param.properties.length).to be 1
|
222
|
+
expect(param.properties.first.name).to eq "baz"
|
223
|
+
end
|
224
|
+
|
225
|
+
it "joins a property with another property that is an array" do
|
226
|
+
params = process_param_with([base_param, prop_three])
|
227
|
+
param = params.first
|
228
|
+
|
229
|
+
expect(params.length).to be 1
|
230
|
+
expect(param.name).to eq base_param
|
231
|
+
expect(param.properties.length).to be 1
|
232
|
+
expect(param.properties.first.name).to eq "qux"
|
233
|
+
end
|
234
|
+
|
235
|
+
it "creates a base param when none exists" do
|
236
|
+
params = process_param_with prop_two
|
237
|
+
param = params.first
|
238
|
+
expect(params.length).to be 1
|
239
|
+
expect(param.name).to eq base_param
|
240
|
+
expect(param.properties.length).to be 1
|
241
|
+
expect(param.properties.first.name).to eq "baz"
|
242
|
+
end
|
243
|
+
|
244
|
+
it "leaves unrelated base params alone" do
|
245
|
+
params = process_param_with [prop_one, prop_two, unrelated]
|
246
|
+
expect(params.length).to be 2
|
247
|
+
expect(params.first.name).to eq base_param
|
248
|
+
expect(params.first.properties.length).to be 2
|
249
|
+
expect(params.last.name).to eq unrelated
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
private
|
254
|
+
|
255
|
+
def process_param_with(content)
|
256
|
+
symbol[subject.name] = content
|
257
|
+
subject.process(symbol)
|
258
|
+
symbol[subject.name]
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Pattern do
|
4
|
+
subject { Docks::Tags::Pattern.instance }
|
5
|
+
|
6
|
+
it "does not allow multiline content" do
|
7
|
+
expect(subject.multiline?).to be false
|
8
|
+
end
|
9
|
+
|
10
|
+
it "only allows one tag per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be false
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
it "does not perform any processing" do
|
16
|
+
content = "foo"
|
17
|
+
expect(subject.process(content)).to eq content
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "post processing" do
|
22
|
+
let(:symbols) do
|
23
|
+
[
|
24
|
+
Docks::Containers::Klass.new(name: "Foo"),
|
25
|
+
Docks::Containers::Factory.new(name: "Bar"),
|
26
|
+
Docks::Containers::Function.new(name: "fooBar"),
|
27
|
+
Docks::Containers::Variable.new(name: "baz")
|
28
|
+
]
|
29
|
+
end
|
30
|
+
|
31
|
+
let(:pattern) do
|
32
|
+
pattern = Docks::Containers::Pattern.new(name: "foo")
|
33
|
+
pattern.add(:script, symbols)
|
34
|
+
pattern
|
35
|
+
end
|
36
|
+
|
37
|
+
before(:each) do
|
38
|
+
Docks::Tags.register(described_class)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "adds the pattern name to all contained symbols" do
|
42
|
+
Docks::Process.process(pattern)
|
43
|
+
|
44
|
+
pattern.symbols.each do |symbol|
|
45
|
+
expect(symbol[subject]).to eq pattern.name
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Preclude do
|
4
|
+
subject { Docks::Tags::Preclude.instance }
|
5
|
+
|
6
|
+
it "does not allow multiline content" do
|
7
|
+
expect(subject.multiline?).to be false
|
8
|
+
end
|
9
|
+
|
10
|
+
it "allows multiple tags per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be true
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
let(:symbol) { Docks::Containers::Symbol.new }
|
16
|
+
|
17
|
+
it "breaks apart precludes on commas, spaces and pipes" do
|
18
|
+
precludes = "foo | bar, baz qux"
|
19
|
+
symbol[subject.name] = precludes
|
20
|
+
subject.process(symbol)
|
21
|
+
expect(symbol[subject.name]).to eq Docks::Processors.split_on_commas_spaces_and_pipes(precludes)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "joins together multiple lines of precludes" do
|
25
|
+
precludes = ["foo | bar, baz qux", "lux fuz"]
|
26
|
+
symbol[subject.name] = precludes.dup
|
27
|
+
subject.process(symbol)
|
28
|
+
expect(symbol[subject.name]).to eq precludes.map { |alias_line| Docks::Processors.split_on_commas_spaces_and_pipes(alias_line) }.flatten
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Private do
|
4
|
+
subject { Docks::Tags::Private.instance }
|
5
|
+
|
6
|
+
it "does not allow multiline content" do
|
7
|
+
expect(subject.multiline?).to be false
|
8
|
+
end
|
9
|
+
|
10
|
+
it "only allows one tag per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be false
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
describe "#process" do
|
16
|
+
let(:symbol) { Docks::Containers::Symbol.new(private: true) }
|
17
|
+
|
18
|
+
before :each do
|
19
|
+
subject.process(symbol)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "sets the access attribute to be private" do
|
23
|
+
expect(symbol.access).to be Docks::Types::Access::PRIVATE
|
24
|
+
end
|
25
|
+
|
26
|
+
it "removes the private attribute" do
|
27
|
+
expect(symbol.private).to be nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Property do
|
4
|
+
subject { Docks::Tags::Property.instance }
|
5
|
+
|
6
|
+
it "does not allow multiline content" do
|
7
|
+
expect(subject.multiline?).to be false
|
8
|
+
end
|
9
|
+
|
10
|
+
it "only allows one tag per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be false
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
it "marks the attribute as true" do
|
16
|
+
symbol = Docks::Containers::Symbol.new(name: "foo", property: "")
|
17
|
+
Docks::Process.process(symbol)
|
18
|
+
expect(symbol[subject.name]).to be true
|
19
|
+
end
|
20
|
+
|
21
|
+
it "forces the symbol to be a variable type" do
|
22
|
+
symbol = Docks::Containers::Symbol.new(name: "foo", property: "")
|
23
|
+
symbol = Docks::Process.process(symbol)
|
24
|
+
expect(symbol).to be_a Docks::Containers::Variable
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Public do
|
4
|
+
subject { Docks::Tags::Public.instance }
|
5
|
+
|
6
|
+
it "does not allow multiline content" do
|
7
|
+
expect(subject.multiline?).to be false
|
8
|
+
end
|
9
|
+
|
10
|
+
it "only allows one tag per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be false
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
let(:symbol) { Docks::Containers::Symbol.new(public: true) }
|
16
|
+
|
17
|
+
before :each do
|
18
|
+
subject.process(symbol)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "sets the access attribute to be public" do
|
22
|
+
expect(symbol.access).to be Docks::Types::Access::PUBLIC
|
23
|
+
end
|
24
|
+
|
25
|
+
it "removes the public attribute" do
|
26
|
+
expect(symbol.public).to be nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Require do
|
4
|
+
subject { Docks::Tags::Require.instance }
|
5
|
+
|
6
|
+
it "does not allow multiline content" do
|
7
|
+
expect(subject.multiline?).to be false
|
8
|
+
end
|
9
|
+
|
10
|
+
it "allows multiple tags per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be true
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
let(:symbol) { Docks::Containers::Symbol.new }
|
16
|
+
|
17
|
+
it "breaks apart requires on commas, spaces and pipes" do
|
18
|
+
requires = "foo | bar, baz qux"
|
19
|
+
symbol[subject.name] = requires
|
20
|
+
subject.process(symbol)
|
21
|
+
expect(symbol[subject.name]).to eq Docks::Processors.split_on_commas_spaces_and_pipes(requires)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "joins together multiple lines of requires" do
|
25
|
+
requires = ["foo | bar, baz qux", "lux fuz"]
|
26
|
+
symbol[subject.name] = requires.dup
|
27
|
+
subject.process(symbol)
|
28
|
+
expect(symbol[subject.name]).to eq requires.map { |alias_line| Docks::Processors.split_on_commas_spaces_and_pipes(alias_line) }.flatten
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "post processing" do
|
33
|
+
before(:each) do
|
34
|
+
Docks::Tags.register_bundled_tags
|
35
|
+
end
|
36
|
+
|
37
|
+
let(:method_one) do
|
38
|
+
Docks::Containers::Function.new(name: "foo", method: true)
|
39
|
+
end
|
40
|
+
|
41
|
+
let(:method_two) do
|
42
|
+
Docks::Containers::Function.new(name: "bar", method: true, static: true)
|
43
|
+
end
|
44
|
+
|
45
|
+
let(:klass) do
|
46
|
+
Docks::Containers::Klass.new(name: "Baz")
|
47
|
+
end
|
48
|
+
|
49
|
+
let(:factory) do
|
50
|
+
Docks::Containers::Factory.new(name: "Qux")
|
51
|
+
end
|
52
|
+
|
53
|
+
let(:pattern_one) do
|
54
|
+
pattern = Docks::Containers::Pattern.new(name: klass.name.downcase)
|
55
|
+
pattern.add(:script, [klass, method_one])
|
56
|
+
pattern
|
57
|
+
end
|
58
|
+
|
59
|
+
let(:pattern_two) do
|
60
|
+
pattern = Docks::Containers::Pattern.new(name: factory.name.downcase)
|
61
|
+
pattern.add(:script, [factory, method_two])
|
62
|
+
pattern
|
63
|
+
end
|
64
|
+
|
65
|
+
let(:pattern_library) do
|
66
|
+
library = Docks::Containers::PatternLibrary.new
|
67
|
+
library << pattern_one
|
68
|
+
library << pattern_two
|
69
|
+
library
|
70
|
+
end
|
71
|
+
|
72
|
+
it "adds used_by associations in the corresponding symbol" do
|
73
|
+
requires = "#{pattern_two.name}::#{factory.name}"
|
74
|
+
|
75
|
+
method_one.requires = requires
|
76
|
+
process_library
|
77
|
+
|
78
|
+
expect(method_one.requires).to eq [requires]
|
79
|
+
expect(factory.used_by).to eq [method_one.to_descriptor]
|
80
|
+
end
|
81
|
+
|
82
|
+
it "adds multiple associations to a single symbol" do
|
83
|
+
requires = "#{pattern_two.name}::#{factory.name}.#{method_two.name}"
|
84
|
+
|
85
|
+
method_one.requires = requires
|
86
|
+
klass.requires = requires
|
87
|
+
|
88
|
+
process_library
|
89
|
+
|
90
|
+
expect(method_one.requires).to eq [requires]
|
91
|
+
expect(klass.requires).to eq [requires]
|
92
|
+
|
93
|
+
expect(method_two.used_by).to eq [
|
94
|
+
method_one.to_descriptor,
|
95
|
+
klass.to_descriptor
|
96
|
+
]
|
97
|
+
end
|
98
|
+
|
99
|
+
it "adds a single symbol with multiple requires" do
|
100
|
+
pattern_require = pattern_two.name
|
101
|
+
method_require = "#{pattern_two.name}::#{factory.name}.#{method_two.name}"
|
102
|
+
|
103
|
+
klass.requires = "#{pattern_require}, #{method_require}"
|
104
|
+
|
105
|
+
process_library
|
106
|
+
|
107
|
+
expect(klass.requires).to eq [pattern_require, method_require]
|
108
|
+
expect(pattern_two.used_by).to eq [klass.to_descriptor]
|
109
|
+
expect(method_two.used_by).to eq [klass.to_descriptor]
|
110
|
+
end
|
111
|
+
|
112
|
+
private
|
113
|
+
|
114
|
+
def process_symbols
|
115
|
+
[method_one, method_two, klass, factory].each do |symbol|
|
116
|
+
Docks::Process.process(symbol)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def process_patterns
|
121
|
+
process_symbols
|
122
|
+
|
123
|
+
[pattern_one, pattern_two].each do |pattern|
|
124
|
+
Docks::Process.process(pattern)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def process_library
|
129
|
+
process_patterns
|
130
|
+
Docks::Process.process(pattern_library)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Docks::Tags::Returns do
|
4
|
+
subject { Docks::Tags::Returns.instance }
|
5
|
+
|
6
|
+
it "allows multiline content" do
|
7
|
+
expect(subject.multiline?).to be true
|
8
|
+
end
|
9
|
+
|
10
|
+
it "allows only one tag per block" do
|
11
|
+
expect(subject.multiple_allowed?).to be false
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#process" do
|
15
|
+
let(:symbol) { Docks::Containers::Symbol.new }
|
16
|
+
let(:types) { "{String | Array Object, Number}" }
|
17
|
+
let(:description) { "This is the description" }
|
18
|
+
|
19
|
+
it "splits apart types when no description is provided" do
|
20
|
+
expect(process_returns_with(types).types).to eq Docks::Processors.split_types(types)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "splits apart types when no description and no curly braces are provided" do
|
24
|
+
expect(process_returns_with(types.gsub("{", "").gsub("}", "")).types).to eq Docks::Processors.split_types(types)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "sets the types to nil when no types are provided" do
|
28
|
+
expect(process_returns_with("").types).to be nil
|
29
|
+
expect(process_returns_with(" ").types).to be nil
|
30
|
+
end
|
31
|
+
|
32
|
+
it "sets the types to nil when 'nothing' is set as the type" do
|
33
|
+
expect(process_returns_with("Nothing ").types).to be nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "preserves a description when the type is nothing" do
|
37
|
+
returns = process_returns_with("nothing - foo")
|
38
|
+
expect(returns.types).to be nil
|
39
|
+
expect(returns.description).to eq "foo"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "splits apart types when a description is provided" do
|
43
|
+
type_results = Docks::Processors.split_types(types)
|
44
|
+
expect(process_returns_with("#{types} #{description}").types).to eq type_results
|
45
|
+
expect(process_returns_with("#{types} - #{description}").types).to eq type_results
|
46
|
+
expect(process_returns_with("#{types} -#{description}").types).to eq type_results
|
47
|
+
expect(process_returns_with("#{types}- #{description}").types).to eq type_results
|
48
|
+
end
|
49
|
+
|
50
|
+
it "returns a nil description when no description is provided" do
|
51
|
+
expect(process_returns_with([types]).description).to be nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it "assigns a description when one is provided" do
|
55
|
+
target_description = Docks::Processors.join_with_smart_line_breaks(description)
|
56
|
+
expect(process_returns_with("#{types} #{description}").description).to eq target_description
|
57
|
+
expect(process_returns_with("#{types} - #{description}").description).to eq target_description
|
58
|
+
expect(process_returns_with("#{types} -#{description}").description).to eq target_description
|
59
|
+
expect(process_returns_with("#{types}- #{description}").description).to eq target_description
|
60
|
+
end
|
61
|
+
|
62
|
+
it "splits a apart types without curly braces with a following description" do
|
63
|
+
types.gsub!("{", "")
|
64
|
+
types.gsub!("}", "")
|
65
|
+
|
66
|
+
type_results = Docks::Processors.split_types(types)
|
67
|
+
expect(process_returns_with("#{types} - #{description}").types).to eq type_results
|
68
|
+
expect(process_returns_with("#{types} -#{description}").types).to eq type_results
|
69
|
+
expect(process_returns_with("#{types}- #{description}").types).to eq type_results
|
70
|
+
|
71
|
+
target_description = Docks::Processors.join_with_smart_line_breaks(description)
|
72
|
+
expect(process_returns_with("#{types} - #{description}").description).to eq target_description
|
73
|
+
expect(process_returns_with("#{types} -#{description}").description).to eq target_description
|
74
|
+
expect(process_returns_with("#{types}- #{description}").description).to eq target_description
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def process_returns_with(content)
|
80
|
+
symbol[subject.name] = content
|
81
|
+
subject.process(symbol)
|
82
|
+
symbol[subject.name]
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|