washout_builder 0.14.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/.rubocop.yml +68 -0
- data/.travis.yml +1 -1
- data/Appraisals +9 -1
- data/Gemfile +2 -3
- data/Rakefile +17 -20
- data/app/controllers/washout_builder/washout_builder_controller.rb +79 -79
- data/app/helpers/washout_builder_complex_type_helper.rb +16 -23
- data/app/helpers/washout_builder_fault_type_helper.rb +12 -13
- data/app/helpers/washout_builder_method_arguments_helper.rb +24 -26
- data/app/helpers/washout_builder_method_list_helper.rb +16 -11
- data/app/helpers/washout_builder_method_return_type_helper.rb +14 -12
- data/app/views/wash_with_html/doc.builder +2 -2
- data/bin/appraisal +16 -0
- data/bin/autospec +16 -0
- data/bin/bundler +16 -0
- data/bin/cdiff +16 -0
- data/bin/coderay +16 -0
- data/bin/colortab +16 -0
- data/bin/coveralls +16 -0
- data/bin/decolor +16 -0
- data/bin/erubis +16 -0
- data/bin/guard +16 -0
- data/bin/htmldiff +16 -0
- data/bin/ldiff +16 -0
- data/bin/listen +16 -0
- data/bin/nokogiri +16 -0
- data/bin/phare +16 -0
- data/bin/pry +16 -0
- data/bin/rackup +16 -0
- data/bin/rails +16 -0
- data/bin/rake +16 -0
- data/bin/restclient +16 -0
- data/bin/rspec +16 -0
- data/bin/rubocop +16 -0
- data/bin/ruby-parse +16 -0
- data/bin/ruby-rewrite +16 -0
- data/bin/sass +16 -0
- data/bin/sass-convert +16 -0
- data/bin/scss +16 -0
- data/bin/scss-lint +16 -0
- data/bin/term_display +16 -0
- data/bin/term_mandel +16 -0
- data/bin/thor +16 -0
- data/bin/uuid +16 -0
- data/config/routes.rb +3 -3
- data/init.rb +1 -1
- data/lib/washout_builder.rb +20 -29
- data/lib/washout_builder/document/complex_type.rb +70 -75
- data/lib/washout_builder/document/exception_model.rb +46 -51
- data/lib/washout_builder/document/generator.rb +56 -66
- data/lib/washout_builder/document/shared_complex_type.rb +2 -4
- data/lib/washout_builder/engine.rb +1 -2
- data/lib/washout_builder/soap.rb +6 -10
- data/lib/washout_builder/type.rb +9 -23
- data/lib/washout_builder/version.rb +5 -5
- data/spec/app/controllers/washout_builder_controller_spec.rb +26 -28
- data/spec/app/helpers/washout_builder_complex_type_helper_spec.rb +37 -45
- data/spec/app/helpers/washout_builder_fault_type_helper_spec.rb +65 -77
- data/spec/app/helpers/washout_builder_method_arguments_helper_spec.rb +65 -76
- data/spec/app/helpers/washout_builder_method_list_helper_spec.rb +30 -35
- data/spec/app/helpers/washout_builder_method_return_type_helper_spec.rb +25 -27
- data/spec/dummy/config/application.rb +4 -4
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/config/environments/development.rb +2 -3
- data/spec/dummy/config/environments/test.rb +3 -3
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -1
- data/spec/dummy/config/routes.rb +0 -1
- data/spec/dummy/script/rails +2 -2
- data/spec/integration/washout_builder_all_services_spec.rb +2 -5
- data/spec/integration/washout_builder_service_spec.rb +2 -5
- data/spec/lib/washout_builder/document/complex_type_spec.rb +98 -118
- data/spec/lib/washout_builder/document/exception_model_spec.rb +49 -54
- data/spec/lib/washout_builder/document/generator_spec.rb +93 -118
- data/spec/lib/washout_builder/type_spec.rb +17 -29
- data/spec/lib/washout_builder_spec.rb +293 -308
- data/spec/spec_helper.rb +24 -30
- data/spec/support/complex_types/fluffy.rb +3 -3
- data/spec/support/complex_types/fluffy_container.rb +3 -3
- data/spec/support/complex_types/project_type.rb +4 -5
- data/spec/support/complex_types/test_type.rb +4 -4
- data/washout_builder.gemspec +5 -2
- metadata +78 -3
@@ -1,86 +1,78 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe WashoutBuilderComplexTypeHelper, :
|
4
|
-
|
3
|
+
describe WashoutBuilderComplexTypeHelper, type: :helper do
|
5
4
|
context '#create_element_type_html' do
|
6
|
-
let
|
7
|
-
let(:element_name) {
|
8
|
-
let(:element) {mock}
|
9
|
-
|
5
|
+
let(:pre) { [] }
|
6
|
+
let(:element_name) { 'custom_name' }
|
7
|
+
let(:element) { mock }
|
8
|
+
|
10
9
|
before(:each) do
|
11
|
-
element.stubs(:type).returns(
|
12
|
-
element.stubs(:type=).with(
|
10
|
+
element.stubs(:type).returns('text')
|
11
|
+
element.stubs(:type=).with('string')
|
13
12
|
element.stubs(:name).returns(element_name)
|
14
13
|
end
|
15
|
-
|
14
|
+
|
16
15
|
def expect_included_type_result(pre, element)
|
17
16
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(element.type).returns(true)
|
18
|
-
result =helper.create_element_type_html(pre, element)
|
17
|
+
result = helper.create_element_type_html(pre, element)
|
19
18
|
result.should eq(["<span class='blue'>#{element.type}</span> <span class='bold'>#{element.name}</span>"])
|
20
19
|
end
|
21
|
-
|
20
|
+
|
22
21
|
def expect_excluded_type_result(pre, element)
|
23
22
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(element.type).returns(false)
|
24
23
|
helper.expects(:create_complex_element_type_html).with(pre, element)
|
25
24
|
helper.create_element_type_html(pre, element)
|
26
25
|
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
element.expects(:type=).with("string")
|
26
|
+
|
27
|
+
it 'returns the element of type text' do
|
28
|
+
element.expects(:type=).with('string')
|
31
29
|
expect_included_type_result(pre, element)
|
32
30
|
end
|
33
|
-
|
34
|
-
it
|
31
|
+
|
32
|
+
it 'returns the element of type text' do
|
35
33
|
expect_excluded_type_result(pre, element)
|
36
34
|
end
|
37
|
-
|
38
|
-
it
|
39
|
-
element.stubs(:type).returns(
|
40
|
-
element.expects(:type=).with(
|
35
|
+
|
36
|
+
it 'returns the element of type integer' do
|
37
|
+
element.stubs(:type).returns('int')
|
38
|
+
element.expects(:type=).with('integer')
|
41
39
|
expect_included_type_result(pre, element)
|
42
40
|
end
|
43
41
|
|
44
|
-
it
|
45
|
-
element.stubs(:type).returns(
|
46
|
-
element.expects(:type=).with(
|
42
|
+
it 'returns the element of type integer' do
|
43
|
+
element.stubs(:type).returns('int')
|
44
|
+
element.expects(:type=).with('integer')
|
47
45
|
expect_excluded_type_result(pre, element)
|
48
46
|
end
|
49
|
-
|
50
|
-
|
51
47
|
end
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
let
|
56
|
-
let(:
|
57
|
-
let(:
|
58
|
-
|
59
|
-
|
48
|
+
|
49
|
+
context 'create_complex_element_type_html' do
|
50
|
+
let(:pre) { [] }
|
51
|
+
let(:element_name) { 'custom_name' }
|
52
|
+
let(:complex_class) { 'SomeClass' }
|
53
|
+
let(:element) { mock }
|
54
|
+
|
60
55
|
before(:each) do
|
61
|
-
element.stubs(:
|
56
|
+
element.stubs(:find_complex_class_name).returns(complex_class)
|
62
57
|
element.stubs(:multiplied).returns(false)
|
63
58
|
element.stubs(:name).returns(element_name)
|
64
59
|
end
|
65
|
-
|
66
|
-
it
|
60
|
+
|
61
|
+
it 'returna simple type element description' do
|
67
62
|
result = helper.create_complex_element_type_html(pre, element)
|
68
63
|
result.should eq(["<a href='##{complex_class}'><span class='lightBlue'>#{complex_class}</span></a> <span class='bold'>#{element.name}</span>"])
|
69
64
|
end
|
70
|
-
|
71
|
-
it
|
65
|
+
|
66
|
+
it 'returns an array type element description' do
|
72
67
|
element.stubs(:multiplied).returns(true)
|
73
68
|
result = helper.create_complex_element_type_html(pre, element)
|
74
69
|
result.should eq(["<a href='##{complex_class}'><span class='lightBlue'>Array of #{complex_class}</span></a> <span class='bold'>#{element.name}</span>"])
|
75
70
|
end
|
76
|
-
|
77
|
-
it
|
78
|
-
element.stubs(:
|
71
|
+
|
72
|
+
it 'returns empty if no complex class' do
|
73
|
+
element.stubs(:find_complex_class_name).returns(nil)
|
79
74
|
result = helper.create_complex_element_type_html(pre, element)
|
80
75
|
result.should eq(nil)
|
81
76
|
end
|
82
|
-
|
83
77
|
end
|
84
|
-
|
85
|
-
|
86
78
|
end
|
@@ -1,139 +1,127 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
|
-
describe WashoutBuilderFaultTypeHelper, :
|
4
|
-
|
5
|
-
context " create_fault_model_complex_element_type" do
|
3
|
+
describe WashoutBuilderFaultTypeHelper, type: :helper do
|
4
|
+
context ' create_fault_model_complex_element_type' do
|
6
5
|
let(:pre) { [] }
|
7
|
-
let(:attr_primitive){
|
8
|
-
let(:attribute) {
|
9
|
-
|
6
|
+
let(:attr_primitive) { 'string' }
|
7
|
+
let(:attribute) { 'custom_attribute' }
|
8
|
+
|
10
9
|
def check_result(array)
|
11
10
|
attribute_primitive = array == true ? "Array of #{attr_primitive}" : "#{attr_primitive}"
|
12
11
|
result = helper. create_fault_model_complex_element_type(pre, attr_primitive, attribute, array)
|
13
12
|
result.should eq(["<a href='##{attr_primitive}'><span class='lightBlue'> #{attribute_primitive}</span></a> <span class='bold'>#{attribute}</span>"])
|
14
13
|
end
|
15
|
-
|
16
|
-
it
|
14
|
+
|
15
|
+
it 'creates an array element ' do
|
17
16
|
check_result(true)
|
18
17
|
end
|
19
|
-
it
|
18
|
+
it 'creates an simple element ' do
|
20
19
|
check_result(false)
|
21
20
|
end
|
22
21
|
end
|
23
|
-
|
24
|
-
context
|
25
|
-
|
26
|
-
|
27
|
-
attr_details = {:member_type => "STRING"}
|
22
|
+
|
23
|
+
context 'member_type_is_basic?' do
|
24
|
+
it 'returns a basic type' do
|
25
|
+
attr_details = { member_type: 'STRING' }
|
28
26
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(attr_details[:member_type].to_s.downcase).returns(true)
|
29
27
|
result = helper.member_type_is_basic?(attr_details)
|
30
28
|
result.should eq(attr_details[:member_type].to_s.downcase)
|
31
29
|
end
|
32
|
-
|
33
|
-
it
|
34
|
-
attr_details = {:
|
30
|
+
|
31
|
+
it 'returns a non-basic type' do
|
32
|
+
attr_details = { member_type: 'STRING' }
|
35
33
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(attr_details[:member_type].to_s.downcase).returns(false)
|
36
34
|
result = helper.member_type_is_basic?(attr_details)
|
37
35
|
result.should eq(attr_details[:member_type])
|
38
36
|
end
|
39
|
-
|
40
37
|
end
|
41
|
-
|
42
|
-
context
|
43
|
-
|
44
|
-
|
45
|
-
attr_details = {:primitive => "STRING"}
|
38
|
+
|
39
|
+
context 'primitive_type_is_basic?' do
|
40
|
+
it 'returns true' do
|
41
|
+
attr_details = { primitive: 'STRING' }
|
46
42
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(attr_details[:primitive].to_s.downcase).returns(true)
|
47
43
|
helper.primitive_type_is_basic?(attr_details).should eq(true)
|
48
44
|
end
|
49
|
-
|
50
|
-
it
|
51
|
-
attr_details = {:
|
45
|
+
|
46
|
+
it 'returns false' do
|
47
|
+
attr_details = { primitive: 'STRING' }
|
52
48
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(attr_details[:primitive].to_s.downcase).returns(false)
|
53
49
|
helper.primitive_type_is_basic?(attr_details).should eq(false)
|
54
50
|
end
|
55
|
-
|
56
51
|
end
|
57
|
-
|
58
|
-
context
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
attr_details
|
63
|
-
helper.get_primitive_type_string(attr_details).should eq("string")
|
52
|
+
|
53
|
+
context 'get_primitive_type_string' do
|
54
|
+
%w(NILCLASS nilclass).each do |primitive|
|
55
|
+
it 'returns string in case of nilclass' do
|
56
|
+
attr_details = { primitive: primitive }
|
57
|
+
helper.get_primitive_type_string(attr_details).should eq('string')
|
64
58
|
end
|
65
59
|
end
|
66
|
-
|
67
|
-
|
68
|
-
it
|
69
|
-
attr_details = {:primitive
|
60
|
+
|
61
|
+
%w(BLA bla).each do |primitive|
|
62
|
+
it 'returns the primitive if not niclass' do
|
63
|
+
attr_details = { primitive: primitive }
|
70
64
|
helper.get_primitive_type_string(attr_details).should eq(primitive.to_s.downcase)
|
71
65
|
end
|
72
66
|
end
|
73
|
-
|
74
67
|
end
|
75
|
-
|
76
|
-
context
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
attr_details = {:primitive => primitive}
|
68
|
+
|
69
|
+
context 'get_member_type_string' do
|
70
|
+
%w(Array array).each do |primitive|
|
71
|
+
it 'checks the member type to be basic if primitive type array' do
|
72
|
+
attr_details = { primitive: primitive }
|
81
73
|
helper.expects(:member_type_is_basic?).with(attr_details).returns(true)
|
82
74
|
helper.get_member_type_string(attr_details).should eq(true)
|
83
75
|
end
|
84
76
|
end
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
attr_details = {:primitive => primitive}
|
77
|
+
|
78
|
+
%w(BLA Bla bla).each do |primitive|
|
79
|
+
it 'returns the primitive type as it is if not array' do
|
80
|
+
attr_details = { primitive: primitive }
|
90
81
|
helper.get_member_type_string(attr_details).should eq(primitive)
|
91
82
|
end
|
92
83
|
end
|
93
|
-
|
94
84
|
end
|
95
|
-
|
96
|
-
context
|
97
|
-
let(:pre) {[]}
|
98
|
-
let(:attribute) {
|
99
|
-
|
85
|
+
|
86
|
+
context 'create_html_fault_model_element_type' do
|
87
|
+
let(:pre) { [] }
|
88
|
+
let(:attribute) { 'some_attribute' }
|
89
|
+
|
100
90
|
before(:each) do
|
101
91
|
helper.stubs(:primitive_type_is_basic?).returns(false)
|
102
92
|
end
|
103
|
-
|
93
|
+
|
104
94
|
def expect_type_string_elem_type(attr_details)
|
105
|
-
type_string =
|
95
|
+
type_string = 'string'
|
106
96
|
helper.expects(:get_primitive_type_string).with(attr_details).returns(type_string)
|
107
|
-
result =helper.create_html_fault_model_element_type(pre, attribute, attr_details)
|
108
|
-
result.should eq([
|
97
|
+
result = helper.create_html_fault_model_element_type(pre, attribute, attr_details)
|
98
|
+
result.should eq(["<span class='blue'>#{type_string}</span> <span class='bold'>#{attribute}</span>"])
|
109
99
|
end
|
110
|
-
|
111
|
-
it
|
112
|
-
attr_details = {:
|
100
|
+
|
101
|
+
it 'returns the string element if primitive type is nilclass' do
|
102
|
+
attr_details = { primitive: 'nilclass' }
|
113
103
|
expect_type_string_elem_type(attr_details)
|
114
104
|
end
|
115
|
-
|
116
|
-
|
117
|
-
it
|
118
|
-
attr_details = {:primitive
|
105
|
+
|
106
|
+
%w(NILCLASS Nilclass BLA).each do |primitive|
|
107
|
+
it 'returns the string type is primitive is basic but not nilclass' do
|
108
|
+
attr_details = { primitive: primitive }
|
119
109
|
helper.expects(:primitive_type_is_basic?).with(attr_details).returns(true)
|
120
110
|
expect_type_string_elem_type(attr_details)
|
121
111
|
end
|
122
112
|
end
|
123
113
|
|
124
|
-
|
125
|
-
it
|
126
|
-
attr_details = {:primitive
|
127
|
-
member_type =
|
128
|
-
expected=
|
114
|
+
%w(NILCLASS Nilclass BLA).each do |primitive|
|
115
|
+
it 'returns the complex type if not basic and not nilclass' do
|
116
|
+
attr_details = { primitive: primitive }
|
117
|
+
member_type = 'SomeMemberType'
|
118
|
+
expected = 'Some expected string'
|
129
119
|
helper.expects(:primitive_type_is_basic?).with(attr_details).returns(false)
|
130
120
|
helper.expects(:get_member_type_string).with(attr_details).returns(member_type)
|
131
|
-
helper.expects(:create_fault_model_complex_element_type).with(pre, member_type, attribute, true
|
132
|
-
result =helper.create_html_fault_model_element_type(pre, attribute, attr_details)
|
121
|
+
helper.expects(:create_fault_model_complex_element_type).with(pre, member_type, attribute, true).returns(expected)
|
122
|
+
result = helper.create_html_fault_model_element_type(pre, attribute, attr_details)
|
133
123
|
result.should eq(expected)
|
134
124
|
end
|
135
125
|
end
|
136
|
-
|
137
126
|
end
|
138
|
-
|
139
127
|
end
|
@@ -1,108 +1,97 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe WashoutBuilderMethodArgumentsHelper, :
|
4
|
-
|
5
|
-
|
6
|
-
context
|
7
|
-
let(:spacer) {
|
8
|
-
let(:pre){[]}
|
9
|
-
let(:param){ mock}
|
10
|
-
let(:complex_class) {
|
11
|
-
let(:param_type) {
|
12
|
-
let(:param_name) {
|
13
|
-
|
3
|
+
describe WashoutBuilderMethodArgumentsHelper, type: :helper do
|
4
|
+
let!(:xml) { Builder::XmlMarkup.new }
|
5
|
+
|
6
|
+
context 'create_method_argument_element' do
|
7
|
+
let(:spacer) { ' ' }
|
8
|
+
let(:pre) { [] }
|
9
|
+
let(:param) { mock }
|
10
|
+
let(:complex_class) { 'SomeComplexClass' }
|
11
|
+
let(:param_type) { 'string' }
|
12
|
+
let(:param_name) { 'some_param_name' }
|
13
|
+
|
14
14
|
before(:each) do
|
15
|
-
param.stubs(:
|
15
|
+
param.stubs(:find_complex_class_name).returns(complex_class)
|
16
16
|
param.stubs(:type).returns(param_type)
|
17
17
|
param.stubs(:name).returns(param_name)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def expect_method_arg_basic_type(mlen)
|
21
|
-
use_spacer =
|
22
|
-
result =
|
23
|
-
result.should eq(["#{use_spacer ? spacer: ''}<span class='blue'>#{param.type}</span> <span class='bold'>#{param.name}</span>"])
|
21
|
+
use_spacer = mlen > 1 ? true : false
|
22
|
+
result = helper.create_method_argument_element(pre, param, mlen)
|
23
|
+
result.should eq(["#{use_spacer ? spacer : ''}<span class='blue'>#{param.type}</span> <span class='bold'>#{param.name}</span>"])
|
24
24
|
end
|
25
|
-
|
26
|
-
[0, 1
|
27
|
-
it
|
25
|
+
|
26
|
+
[0, 1, 2, 3, 4].each do |mlen|
|
27
|
+
it 'returns a basic type' do
|
28
28
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(param.type).returns(true)
|
29
|
-
expect_method_arg_basic_type(mlen)
|
29
|
+
expect_method_arg_basic_type(mlen)
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
33
|
-
[0, 1
|
34
|
-
it
|
32
|
+
|
33
|
+
[0, 1, 2, 3, 4].each do |mlen|
|
34
|
+
it 'returns array of complex type' do
|
35
35
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(param.type).returns(false)
|
36
36
|
param.expects(:multiplied).returns(true)
|
37
|
-
use_spacer =
|
38
|
-
result =
|
39
|
-
result.should eq(
|
37
|
+
use_spacer = mlen > 1 ? true : false
|
38
|
+
result = helper.create_method_argument_element(pre, param, mlen)
|
39
|
+
result.should eq(["#{use_spacer ? spacer : ''}<a href='##{complex_class}'><span class='lightBlue'>Array of #{complex_class}</span></a> <span class='bold'>#{param.name}</span>"])
|
40
40
|
end
|
41
41
|
end
|
42
|
-
|
43
|
-
[0, 1
|
44
|
-
it
|
42
|
+
|
43
|
+
[0, 1, 2, 3, 4].each do |mlen|
|
44
|
+
it 'returns simple complex type' do
|
45
45
|
WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(param.type).returns(false)
|
46
46
|
param.expects(:multiplied).returns(false)
|
47
|
-
use_spacer =
|
48
|
-
result =
|
49
|
-
result.should eq(
|
47
|
+
use_spacer = mlen > 1 ? true : false
|
48
|
+
result = helper.create_method_argument_element(pre, param, mlen)
|
49
|
+
result.should eq(["#{use_spacer ? spacer : ''}<a href='##{complex_class}'><span class='lightBlue'>#{complex_class}</span></a> <span class='bold'>#{param.name}</span>"])
|
50
50
|
end
|
51
51
|
end
|
52
|
-
|
53
|
-
|
54
52
|
end
|
55
|
-
|
56
|
-
context
|
57
|
-
|
58
|
-
|
59
|
-
result = helper.create_argument_element_spacer(xml, 0, 1)
|
53
|
+
|
54
|
+
context 'create_argument_element_spacer' do
|
55
|
+
it 'returns only the ) in bold ' do
|
56
|
+
helper.create_argument_element_spacer(xml, 0, 1)
|
60
57
|
xml.target!.should eq("<span class=\"bold\">)</span>")
|
61
58
|
end
|
62
|
-
|
63
|
-
it
|
64
|
-
|
65
|
-
xml.target!.should eq(
|
59
|
+
|
60
|
+
it 'returns only the span with comma' do
|
61
|
+
helper.create_argument_element_spacer(xml, -2, 1)
|
62
|
+
xml.target!.should eq('<span>, </span>')
|
66
63
|
end
|
67
|
-
|
68
|
-
it
|
69
|
-
|
70
|
-
xml.target!.should eq(
|
64
|
+
|
65
|
+
it 'returns only the span with comma and a break ' do
|
66
|
+
helper.create_argument_element_spacer(xml, 1, 3)
|
67
|
+
xml.target!.should eq('<span>, </span><br/>')
|
71
68
|
end
|
72
|
-
|
73
|
-
it
|
74
|
-
|
69
|
+
|
70
|
+
it 'returns a break and a ) sign ' do
|
71
|
+
helper.create_argument_element_spacer(xml, 2, 3)
|
75
72
|
xml.target!.should eq("<br/><span class=\"bold\">)</span>")
|
76
73
|
end
|
77
|
-
|
74
|
+
|
78
75
|
[3, 4, 4, 5, 6].each do |j_value|
|
79
|
-
it
|
80
|
-
|
81
|
-
xml.target!.should eq(
|
76
|
+
it 'returns only the span with comma ' do
|
77
|
+
helper.create_argument_element_spacer(xml, j_value, 3)
|
78
|
+
xml.target!.should eq('<br/>')
|
82
79
|
end
|
83
80
|
end
|
84
|
-
|
85
|
-
|
86
|
-
|
87
81
|
end
|
88
|
-
|
89
|
-
context
|
90
|
-
let(:pre) {[]}
|
91
|
-
let(:element) {mock}
|
92
|
-
let(:second_element){mock}
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
82
|
+
|
83
|
+
context 'create_html_public_method_arguments' do
|
84
|
+
let(:pre) { [] }
|
85
|
+
let(:element) { mock }
|
86
|
+
let(:second_element) { mock }
|
87
|
+
|
88
|
+
it 'returns only the span with comma ' do
|
89
|
+
input = [element, second_element]
|
90
|
+
|
91
|
+
helper.stubs(:create_method_argument_element).returns('bla')
|
92
|
+
helper.stubs(:create_argument_element_spacer).returns('blabla')
|
93
|
+
helper. create_html_public_method_arguments(xml, pre, input)
|
94
|
+
xml.target!.should eq('<br/>')
|
95
|
+
end
|
103
96
|
end
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
97
|
end
|