tbpgr_utils 0.0.150 → 0.0.151
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +9 -9
- data/README.md +95 -32
- data/lib/attr_enumerable/attr_enumerable_helper.rb +52 -52
- data/lib/attr_enumerable/map_attr.rb +1 -1
- data/lib/eval_helper/attr_accessor_init_code.rb +3 -3
- data/lib/eval_helper/each_do_code.rb +26 -26
- data/lib/eval_helper/each_with_index_do_code.rb +26 -26
- data/lib/eval_helper/require_code.rb +1 -1
- data/lib/eval_helper/require_relative_code.rb +1 -1
- data/lib/eval_helper/set_variable_code.rb +1 -1
- data/lib/eval_helper/set_variables_code.rb +1 -1
- data/lib/eval_helper/times_code.rb +1 -1
- data/lib/ghostable.rb +1 -1
- data/lib/open_classes/array.rb +0 -2
- data/lib/open_classes/array/average.rb +17 -17
- data/lib/open_classes/array/gte_gte.rb +1 -1
- data/lib/open_classes/array/to_table.rb +1 -1
- data/lib/open_classes/array/together_clear.rb +24 -24
- data/lib/open_classes/array/together_compact.rb +44 -44
- data/lib/open_classes/array/together_empty.rb +1 -1
- data/lib/open_classes/array/together_include.rb +1 -1
- data/lib/open_classes/enumerable.rb +4 -0
- data/lib/open_classes/enumerable/if_else_map.rb +12 -0
- data/lib/open_classes/{array → enumerable}/kernel_send.rb +15 -15
- data/lib/open_classes/{array → enumerable}/sum.rb +3 -3
- data/lib/open_classes/hash/gte_gte.rb +45 -45
- data/lib/open_classes/integer/each_digit.rb +13 -13
- data/lib/open_classes/integer/each_digit_with_index.rb +13 -13
- data/lib/open_classes/integer/reverse_each_digit.rb +13 -13
- data/lib/open_classes/kernel/aa_ancestors.rb +1 -1
- data/lib/open_classes/numeric/is_ascii.rb +4 -4
- data/lib/open_classes/object/any_of.rb +1 -2
- data/lib/open_classes/object/to_bool.rb +1 -1
- data/lib/open_classes/string/ascii_unicode_html_table.rb +1 -1
- data/lib/open_classes/string/ascii_unicode_table.rb +1 -1
- data/lib/open_classes/string/is_meta_variable.rb +7 -7
- data/lib/open_classes/string/justify_table.rb +2 -2
- data/lib/open_classes/string/surround.rb +2 -2
- data/lib/open_classes/symbol/is_meta_variable.rb +6 -6
- data/lib/tbpgr_utils.rb +1 -0
- data/lib/tbpgr_utils/version.rb +1 -1
- data/lib/templatable.rb +1 -1
- data/rubocop-todo.yml +2 -36
- data/spec/attr_enumerable/each_attr_spec.rb +1 -1
- data/spec/attr_enumerable/each_attr_with_index_spec.rb +1 -1
- data/spec/attr_enumerable/first_attr_spec.rb +107 -107
- data/spec/attr_enumerable/include_attr_spec.rb +4 -4
- data/spec/attr_enumerable/last_attr_spec.rb +4 -4
- data/spec/attr_enumerable/map_attr_spec.rb +3 -3
- data/spec/attr_enumerable/reduce_attr_spec.rb +3 -3
- data/spec/attr_enumerable/reverse_attr_spec.rb +1 -1
- data/spec/attr_enumerable/sample_attr_spec.rb +3 -3
- data/spec/attr_enumerable/select_attr_spec.rb +2 -2
- data/spec/attr_enumerable/shuffle_attr_spec.rb +1 -1
- data/spec/attr_enumerable/slice_attr_spec.rb +1 -1
- data/spec/attributes_hashable_spec.rb +1 -1
- data/spec/attributes_initializable_spec.rb +21 -21
- data/spec/eval_helper/attr_accessor_init_code_spec.rb +1 -1
- data/spec/eval_helper/attr_init_class_code_spec.rb +1 -1
- data/spec/eval_helper/each_brace_code_spec.rb +2 -2
- data/spec/eval_helper/each_do_code_spec.rb +1 -1
- data/spec/eval_helper/each_with_index_brace_code_spec.rb +2 -2
- data/spec/eval_helper/each_with_index_do_code_spec.rb +2 -2
- data/spec/eval_helper/if_code_after_spec.rb +3 -3
- data/spec/eval_helper/if_code_spec.rb +3 -3
- data/spec/eval_helper/require_code_spec.rb +3 -3
- data/spec/eval_helper/require_relative_code_spec.rb +3 -3
- data/spec/eval_helper/set_variable_code_spec.rb +3 -3
- data/spec/{set_variables_code_spec.rb → eval_helper/set_variables_code_spec.rb} +15 -15
- data/spec/eval_helper/ternary_operator_spec.rb +5 -5
- data/spec/eval_helper/times_code_spec.rb +1 -1
- data/spec/eval_helper/unless_code_after_spec.rb +3 -3
- data/spec/eval_helper/unless_code_spec.rb +3 -3
- data/spec/familyable/familyable_spec.rb +6 -6
- data/spec/ghostable_spec.rb +5 -5
- data/spec/markdown/backquotes_spec.rb +4 -4
- data/spec/markdown/bold_spec.rb +4 -4
- data/spec/markdown/code_spec.rb +3 -3
- data/spec/markdown/codes_spec.rb +2 -2
- data/spec/markdown/heading_spec.rb +5 -5
- data/spec/markdown/hr_spec.rb +1 -1
- data/spec/markdown/italic_spec.rb +4 -4
- data/spec/markdown/link_spec.rb +1 -1
- data/spec/markdown/ol_spec.rb +3 -3
- data/spec/markdown/ul_spec.rb +3 -3
- data/spec/metasyntactic_variable_spec.rb +4 -4
- data/spec/open_classes/array/average_spec.rb +4 -4
- data/spec/open_classes/array/exchange_spec.rb +6 -6
- data/spec/open_classes/array/gte_gte_spec.rb +4 -4
- data/spec/open_classes/array/to_html_table_spec.rb +3 -3
- data/spec/open_classes/array/to_table_spec.rb +2 -2
- data/spec/open_classes/array/together_at_spec.rb +4 -4
- data/spec/open_classes/array/together_clear_spec.rb +3 -3
- data/spec/open_classes/array/together_compact_spec.rb +6 -6
- data/spec/open_classes/array/together_concat_spec.rb +3 -3
- data/spec/open_classes/array/together_delete_at_spec.rb +5 -5
- data/spec/open_classes/array/together_delete_if_spec.rb +4 -4
- data/spec/open_classes/array/together_delete_spec.rb +5 -5
- data/spec/open_classes/array/together_empty_spec.rb +4 -4
- data/spec/open_classes/array/together_fill_spec.rb +5 -5
- data/spec/open_classes/array/together_first_spec.rb +6 -6
- data/spec/open_classes/array/together_include_spec.rb +8 -8
- data/spec/open_classes/array/together_index_spec.rb +5 -5
- data/spec/open_classes/array/together_insert_spec.rb +5 -5
- data/spec/open_classes/array/together_last_spec.rb +6 -6
- data/spec/open_classes/array/together_map_spec.rb +14 -14
- data/spec/open_classes/array/together_pop_spec.rb +8 -8
- data/spec/open_classes/array/together_reduce_spec.rb +8 -8
- data/spec/open_classes/array/together_reverse_spec.rb +119 -119
- data/spec/open_classes/array/together_sample_spec.rb +8 -8
- data/spec/open_classes/array/together_select_spec.rb +6 -6
- data/spec/open_classes/array/together_shift_spec.rb +8 -8
- data/spec/open_classes/array/together_shuffle_spec.rb +3 -3
- data/spec/open_classes/array/together_slice_spec.rb +5 -5
- data/spec/open_classes/array/together_spec.rb +3 -3
- data/spec/open_classes/array/together_with_index_spec.rb +3 -3
- data/spec/open_classes/array/uniq_size_spec.rb +4 -4
- data/spec/open_classes/enumerable/if_else_map_spec.rb +45 -0
- data/spec/open_classes/{array → enumerable}/kernel_send_spec.rb +50 -43
- data/spec/open_classes/{array → enumerable}/sum_spec.rb +8 -2
- data/spec/open_classes/fixnum/to_fixnum_html_table_spec.rb +1 -1
- data/spec/open_classes/fixnum/to_fixnum_table_spec.rb +1 -1
- data/spec/open_classes/hash/gte_gte_spec.rb +4 -4
- data/spec/open_classes/hash/html_table_spec.rb +2 -2
- data/spec/open_classes/hash/table_spec.rb +2 -2
- data/spec/open_classes/integer/each_digit_spec.rb +2 -2
- data/spec/open_classes/integer/each_digit_with_index_spec.rb +2 -2
- data/spec/open_classes/integer/palindromic_prime_spec.rb +6 -6
- data/spec/open_classes/integer/reverse_each_digit_spec.rb +2 -2
- data/spec/open_classes/kernel/aa_ancestors_spec.rb +1 -1
- data/spec/open_classes/kernel/booleans_spec.rb +1 -1
- data/spec/open_classes/kernel/bulk_define_methods_spec.rb +5 -5
- data/spec/open_classes/kernel/bulk_puts_eval_spec.rb +1 -1
- data/spec/open_classes/kernel/evalb_spec.rb +2 -2
- data/spec/open_classes/kernel/exchange_spec.rb +2 -2
- data/spec/open_classes/kernel/hash_to_attributes_spec.rb +3 -3
- data/spec/open_classes/kernel/null_spec.rb +1 -1
- data/spec/open_classes/kernel/print_eval_spec.rb +3 -3
- data/spec/open_classes/kernel/puts_eval_spec.rb +3 -3
- data/spec/open_classes/module_spec.rb +3 -3
- data/spec/open_classes/numeric/dice_back_spec.rb +8 -8
- data/spec/open_classes/numeric/dozen_spec.rb +4 -4
- data/spec/open_classes/numeric/is_ascii_spec.rb +6 -6
- data/spec/open_classes/numeric/to_binary_html_table_spec.rb +1 -1
- data/spec/open_classes/numeric/to_binary_table_spec.rb +1 -1
- data/spec/open_classes/numeric/to_digit_html_table_spec.rb +1 -1
- data/spec/open_classes/numeric/to_digit_table_spec.rb +1 -1
- data/spec/open_classes/numeric/to_hex_html_table_spec.rb +1 -1
- data/spec/open_classes/numeric/to_hex_table_spec.rb +1 -1
- data/spec/open_classes/numeric/to_oct_html_table_spec.rb +1 -1
- data/spec/open_classes/numeric/to_oct_table_spec.rb +1 -1
- data/spec/open_classes/object/any_of_spec.rb +6 -6
- data/spec/open_classes/object/boolean_spec.rb +6 -6
- data/spec/open_classes/object/grep_instance_method_spec.rb +15 -15
- data/spec/open_classes/object/grep_method_spec.rb +6 -6
- data/spec/open_classes/object/guard_spec.rb +8 -8
- data/spec/open_classes/object/method_nameable_spec.rb +4 -4
- data/spec/open_classes/object/my_methods_spec.rb +2 -2
- data/spec/open_classes/object/null_spec.rb +1 -1
- data/spec/open_classes/object/to_bool_spec.rb +7 -7
- data/spec/open_classes/string/ascii1_other2_size_spec.rb +5 -5
- data/spec/open_classes/string/ascii_unicode_html_table_spec.rb +1 -1
- data/spec/open_classes/string/ascii_unicode_table_spec.rb +1 -1
- data/spec/open_classes/string/comma_to_a_spec.rb +1 -1
- data/spec/open_classes/string/cygwinpath_to_winpath_spec.rb +3 -3
- data/spec/open_classes/string/escape_double_quote_spec.rb +3 -3
- data/spec/open_classes/string/escape_quote_spec.rb +3 -3
- data/spec/open_classes/string/gte_gte_spec.rb +3 -3
- data/spec/open_classes/string/hyphen_to_a_spec.rb +1 -1
- data/spec/open_classes/string/is_meta_variable_spec.rb +3 -3
- data/spec/open_classes/string/justify_char_spec.rb +6 -6
- data/spec/open_classes/string/justify_table_spec.rb +6 -6
- data/spec/open_classes/string/say_spec.rb +2 -2
- data/spec/open_classes/string/spacing_spec.rb +6 -6
- data/spec/open_classes/string/surround_spec.rb +1 -1
- data/spec/open_classes/string/table_to_array_spec.rb +1 -1
- data/spec/open_classes/string/to_hatena_heading_spec.rb +5 -5
- data/spec/open_classes/string/to_markdown_heading_spec.rb +5 -5
- data/spec/open_classes/string/to_space2_heading_spec.rb +5 -5
- data/spec/open_classes/string/to_space4_heading_spec.rb +5 -5
- data/spec/open_classes/string/to_tab_heading_spec.rb +5 -5
- data/spec/open_classes/string/unescape_double_quote_spec.rb +3 -3
- data/spec/open_classes/string/unescape_quote_spec.rb +3 -3
- data/spec/open_classes/string/uniq_size_spec.rb +4 -4
- data/spec/open_classes/string/uniq_spec.rb +4 -4
- data/spec/open_classes/string/winpath_to_cygwinpath_spec.rb +3 -3
- data/spec/open_classes/symbol/is_meta_variable_spec.rb +3 -3
- data/spec/simple_tournament_spec.rb +9 -9
- data/spec/templatable_spec.rb +2 -2
- data/spec/template_methodable_spec.rb +1 -1
- data/spec/test_toolbox/kernel_spec.rb +7 -7
- data/tbpgr_utils.gemspec +4 -4
- metadata +15 -11
@@ -3,12 +3,12 @@ require 'spec_helper'
|
|
3
3
|
require 'eval_helper'
|
4
4
|
|
5
5
|
describe 'EvalHelper' do
|
6
|
-
context :
|
6
|
+
context :setting_variable_code do
|
7
7
|
class EvalHelperSetVariableTest
|
8
8
|
include EvalHelper
|
9
9
|
|
10
10
|
def hoge(name, value)
|
11
|
-
|
11
|
+
setting_variable_code(name, value)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
cases = [
|
@@ -25,7 +25,7 @@ describe 'EvalHelper' do
|
|
25
25
|
name: 'hoge_num',
|
26
26
|
value: '1',
|
27
27
|
expected: 'hoge_num = 1'
|
28
|
-
}
|
28
|
+
}
|
29
29
|
]
|
30
30
|
|
31
31
|
cases.each do |c|
|
@@ -3,12 +3,12 @@ require 'spec_helper'
|
|
3
3
|
require 'eval_helper'
|
4
4
|
|
5
5
|
describe 'EvalHelper' do
|
6
|
-
context :
|
6
|
+
context :setting_variables_code do
|
7
7
|
class EvalHelperSetVariablesTest
|
8
8
|
include EvalHelper
|
9
9
|
|
10
10
|
def hoge(variables)
|
11
|
-
|
11
|
+
setting_variables_code(variables)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
cases = [
|
@@ -18,12 +18,12 @@ describe 'EvalHelper' do
|
|
18
18
|
variables: [
|
19
19
|
{
|
20
20
|
name: 'name1',
|
21
|
-
value: '"value1"'
|
21
|
+
value: '"value1"'
|
22
22
|
},
|
23
23
|
{
|
24
24
|
name: 'name2',
|
25
|
-
value: '"value2"'
|
26
|
-
}
|
25
|
+
value: '"value2"'
|
26
|
+
}
|
27
27
|
],
|
28
28
|
expected: %(name1 = "value1"
|
29
29
|
name2 = "value2")
|
@@ -32,7 +32,7 @@ name2 = "value2")
|
|
32
32
|
case_no: 2,
|
33
33
|
case_title: 'not hash case',
|
34
34
|
variables: 'hoge',
|
35
|
-
expect_error: true
|
35
|
+
expect_error: true
|
36
36
|
},
|
37
37
|
{
|
38
38
|
case_no: 3,
|
@@ -40,14 +40,14 @@ name2 = "value2")
|
|
40
40
|
variables: [
|
41
41
|
{
|
42
42
|
not_name: 'name1',
|
43
|
-
value: '"value1"'
|
43
|
+
value: '"value1"'
|
44
44
|
},
|
45
45
|
{
|
46
46
|
not_name: 'name2',
|
47
|
-
value: '"value3"'
|
48
|
-
}
|
47
|
+
value: '"value3"'
|
48
|
+
}
|
49
49
|
],
|
50
|
-
expect_error: true
|
50
|
+
expect_error: true
|
51
51
|
},
|
52
52
|
{
|
53
53
|
case_no: 4,
|
@@ -55,15 +55,15 @@ name2 = "value2")
|
|
55
55
|
variables: [
|
56
56
|
{
|
57
57
|
name: 'name1',
|
58
|
-
not_value: '"value1"'
|
58
|
+
not_value: '"value1"'
|
59
59
|
},
|
60
60
|
{
|
61
61
|
name: 'name2',
|
62
|
-
not_value: '"value3"'
|
63
|
-
}
|
62
|
+
not_value: '"value3"'
|
63
|
+
}
|
64
64
|
],
|
65
|
-
expect_error: true
|
66
|
-
}
|
65
|
+
expect_error: true
|
66
|
+
}
|
67
67
|
]
|
68
68
|
|
69
69
|
cases.each do |c|
|
@@ -26,7 +26,7 @@ describe 'EvalHelper' do
|
|
26
26
|
cond: "msg == 'test'",
|
27
27
|
true_case: 'true',
|
28
28
|
false_case: 'false',
|
29
|
-
expected: true
|
29
|
+
expected: true
|
30
30
|
},
|
31
31
|
{
|
32
32
|
case_no: 2,
|
@@ -35,7 +35,7 @@ describe 'EvalHelper' do
|
|
35
35
|
cond: "msg == 'test'",
|
36
36
|
true_case: 'true',
|
37
37
|
false_case: 'false',
|
38
|
-
expected: false
|
38
|
+
expected: false
|
39
39
|
},
|
40
40
|
{
|
41
41
|
case_no: 3,
|
@@ -45,7 +45,7 @@ describe 'EvalHelper' do
|
|
45
45
|
true_case: 'true',
|
46
46
|
false_case: 'false',
|
47
47
|
ret: 'result',
|
48
|
-
expected: true
|
48
|
+
expected: true
|
49
49
|
},
|
50
50
|
{
|
51
51
|
case_no: 4,
|
@@ -55,8 +55,8 @@ describe 'EvalHelper' do
|
|
55
55
|
true_case: 'true',
|
56
56
|
false_case: 'false',
|
57
57
|
ret: 'result',
|
58
|
-
expected: false
|
59
|
-
}
|
58
|
+
expected: false
|
59
|
+
}
|
60
60
|
]
|
61
61
|
|
62
62
|
cases.each do |c|
|
@@ -22,7 +22,7 @@ describe 'EvalHelper' do
|
|
22
22
|
input: 'not_test',
|
23
23
|
unless_cond: "msg == 'test'",
|
24
24
|
unless_proc: 'ret = "true"',
|
25
|
-
expected: 'true'
|
25
|
+
expected: 'true'
|
26
26
|
},
|
27
27
|
{
|
28
28
|
case_no: 2,
|
@@ -30,8 +30,8 @@ describe 'EvalHelper' do
|
|
30
30
|
input: 'test',
|
31
31
|
unless_cond: "msg == 'test'",
|
32
32
|
unless_proc: 'ret = "true"',
|
33
|
-
expected: 'dafault'
|
34
|
-
}
|
33
|
+
expected: 'dafault'
|
34
|
+
}
|
35
35
|
]
|
36
36
|
|
37
37
|
cases.each do |c|
|
@@ -21,7 +21,7 @@ describe 'EvalHelper' do
|
|
21
21
|
unless_cond: "msg == 'test'",
|
22
22
|
unless_proc: 'true',
|
23
23
|
else_proc: 'false',
|
24
|
-
expected: true
|
24
|
+
expected: true
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 2,
|
@@ -30,8 +30,8 @@ describe 'EvalHelper' do
|
|
30
30
|
unless_cond: "msg == 'test'",
|
31
31
|
unless_proc: 'true',
|
32
32
|
else_proc: 'false',
|
33
|
-
expected: false
|
34
|
-
}
|
33
|
+
expected: false
|
34
|
+
}
|
35
35
|
]
|
36
36
|
|
37
37
|
cases.each do |c|
|
@@ -13,11 +13,11 @@ describe Familyable::Family do
|
|
13
13
|
b = Familyable::Person.new(id: 2, parent_ids: []),
|
14
14
|
c = Familyable::Person.new(id: 3, parent_ids: [4]),
|
15
15
|
d = Familyable::Person.new(id: 4, parent_ids: []),
|
16
|
-
e = Familyable::Person.new(id: 5, parent_ids: [2])
|
16
|
+
e = Familyable::Person.new(id: 5, parent_ids: [2])
|
17
17
|
],
|
18
18
|
index: 0,
|
19
19
|
expected: [1, 2]
|
20
|
-
}
|
20
|
+
}
|
21
21
|
]
|
22
22
|
|
23
23
|
cases.each do |c|
|
@@ -61,11 +61,11 @@ describe Familyable::Family do
|
|
61
61
|
b = Familyable::Person.new(id: 2, parent_ids: []),
|
62
62
|
c = Familyable::Person.new(id: 3, parent_ids: [4]),
|
63
63
|
d = Familyable::Person.new(id: 4, parent_ids: []),
|
64
|
-
e = Familyable::Person.new(id: 5, parent_ids: [2])
|
64
|
+
e = Familyable::Person.new(id: 5, parent_ids: [2])
|
65
65
|
],
|
66
66
|
index: 1,
|
67
67
|
expected: [0, 4]
|
68
|
-
}
|
68
|
+
}
|
69
69
|
]
|
70
70
|
|
71
71
|
cases.each do |c|
|
@@ -109,11 +109,11 @@ describe Familyable::Family do
|
|
109
109
|
b = Familyable::Person.new(id: 2, parent_ids: []),
|
110
110
|
c = Familyable::Person.new(id: 3, parent_ids: [4]),
|
111
111
|
d = Familyable::Person.new(id: 4, parent_ids: [3]),
|
112
|
-
e = Familyable::Person.new(id: 5, parent_ids: [2])
|
112
|
+
e = Familyable::Person.new(id: 5, parent_ids: [2])
|
113
113
|
],
|
114
114
|
index: 0,
|
115
115
|
expected: [3, 4]
|
116
|
-
}
|
116
|
+
}
|
117
117
|
]
|
118
118
|
|
119
119
|
cases.each do |c|
|
data/spec/ghostable_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Ghostable do
|
|
6
6
|
context :ghost_method do
|
7
7
|
module Checkable
|
8
8
|
include Ghostable
|
9
|
-
ghost_method
|
9
|
+
ghost_method(/check_range_.*\?$/, :check_range) do |method_name, *args, &block|
|
10
10
|
method_name.to_s =~ /(check_range_)(\d+)(_to_)(\d*)/
|
11
11
|
from = Regexp.last_match[2].to_i
|
12
12
|
to = Regexp.last_match[4].to_i
|
@@ -14,7 +14,7 @@ describe Ghostable do
|
|
14
14
|
(from..to).include? value
|
15
15
|
end
|
16
16
|
|
17
|
-
ghost_method
|
17
|
+
ghost_method(/^contain_.*\?$/, :check_contain) do |method_name, *args, &block|
|
18
18
|
method_name.to_s =~ /^(contain_)(.*)(\?)/
|
19
19
|
word = Regexp.last_match[2]
|
20
20
|
value = args.first
|
@@ -31,9 +31,9 @@ describe Ghostable do
|
|
31
31
|
case_no: 1,
|
32
32
|
case_title: 'valid case',
|
33
33
|
klass: SampleChecker,
|
34
|
-
methods: [:check_range_3_to_5?, :check_range_3_to_5
|
34
|
+
methods: [:check_range_3_to_5?, :check_range_3_to_5?, :contain_hoge?, :contain_hoge?],
|
35
35
|
values: [3, 6, 'testhogetest', 'testhigetest'],
|
36
|
-
expecteds: [true, false, true, false]
|
36
|
+
expecteds: [true, false, true, false]
|
37
37
|
},
|
38
38
|
{
|
39
39
|
case_no: 2,
|
@@ -42,7 +42,7 @@ describe Ghostable do
|
|
42
42
|
methods: [:not_match_method],
|
43
43
|
values: [nil],
|
44
44
|
expect_error: true
|
45
|
-
}
|
45
|
+
}
|
46
46
|
]
|
47
47
|
|
48
48
|
cases.each do |c|
|
@@ -15,20 +15,20 @@ describe MarkdownString do
|
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'not string case',
|
17
17
|
input: 1,
|
18
|
-
expected: 1
|
18
|
+
expected: 1
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: 'empty case',
|
23
23
|
input: '',
|
24
|
-
expected: '>'
|
24
|
+
expected: '>'
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 4,
|
28
28
|
case_title: 'nil case',
|
29
29
|
input: nil,
|
30
|
-
expected: '>'
|
31
|
-
}
|
30
|
+
expected: '>'
|
31
|
+
}
|
32
32
|
]
|
33
33
|
|
34
34
|
cases.each do |c|
|
data/spec/markdown/bold_spec.rb
CHANGED
@@ -15,20 +15,20 @@ describe MarkdownString do
|
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'empty case',
|
17
17
|
input: '',
|
18
|
-
expected: '****'
|
18
|
+
expected: '****'
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: 'nil case',
|
23
23
|
input: nil,
|
24
|
-
expected: '****'
|
24
|
+
expected: '****'
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 4,
|
28
28
|
case_title: 'not string case',
|
29
29
|
input: 1,
|
30
|
-
expected: 1
|
31
|
-
}
|
30
|
+
expected: 1
|
31
|
+
}
|
32
32
|
]
|
33
33
|
|
34
34
|
cases.each do |c|
|
data/spec/markdown/code_spec.rb
CHANGED
@@ -15,20 +15,20 @@ describe MarkdownString do
|
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'not string case',
|
17
17
|
input: 1,
|
18
|
-
expected: 1
|
18
|
+
expected: 1
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: 'empty case',
|
23
23
|
input: '',
|
24
|
-
expected: '``'
|
24
|
+
expected: '``'
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 4,
|
28
28
|
case_title: 'nil case',
|
29
29
|
input: nil,
|
30
30
|
expected: '``'
|
31
|
-
}
|
31
|
+
}
|
32
32
|
]
|
33
33
|
|
34
34
|
cases.each do |c|
|
data/spec/markdown/codes_spec.rb
CHANGED
@@ -10,26 +10,26 @@ describe MarkdownString do
|
|
10
10
|
case_no: 1,
|
11
11
|
case_title: 'normal case',
|
12
12
|
input: "heading#{i}",
|
13
|
-
expected: "#{'#' * i} heading#{i}"
|
13
|
+
expected: "#{'#' * i} heading#{i}"
|
14
14
|
},
|
15
15
|
{
|
16
16
|
case_no: 2,
|
17
17
|
case_title: 'empty case',
|
18
18
|
input: '',
|
19
|
-
expected: "#{'#' * i} "
|
19
|
+
expected: "#{'#' * i} "
|
20
20
|
},
|
21
21
|
{
|
22
22
|
case_no: 3,
|
23
23
|
case_title: 'nil case',
|
24
24
|
input: '',
|
25
|
-
expected: "#{'#' * i} "
|
25
|
+
expected: "#{'#' * i} "
|
26
26
|
},
|
27
27
|
{
|
28
28
|
case_no: 4,
|
29
29
|
case_title: 'not String case',
|
30
30
|
input: 12_345,
|
31
|
-
expected: "#{'#' * i} 12345"
|
32
|
-
}
|
31
|
+
expected: "#{'#' * i} 12345"
|
32
|
+
}
|
33
33
|
]
|
34
34
|
|
35
35
|
cases.each do |c|
|
data/spec/markdown/hr_spec.rb
CHANGED
@@ -15,20 +15,20 @@ describe MarkdownString do
|
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'empty case',
|
17
17
|
input: '',
|
18
|
-
expected: '**'
|
18
|
+
expected: '**'
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: 'nil case',
|
23
23
|
input: nil,
|
24
|
-
expected: '**'
|
24
|
+
expected: '**'
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 4,
|
28
28
|
case_title: 'not string case',
|
29
29
|
input: 1,
|
30
|
-
expected: 1
|
31
|
-
}
|
30
|
+
expected: 1
|
31
|
+
}
|
32
32
|
]
|
33
33
|
|
34
34
|
cases.each do |c|
|
data/spec/markdown/link_spec.rb
CHANGED
data/spec/markdown/ol_spec.rb
CHANGED
@@ -19,20 +19,20 @@ describe MarkdownString do
|
|
19
19
|
case_no: 2,
|
20
20
|
case_title: 'not list case',
|
21
21
|
input: 'hoge',
|
22
|
-
expected: 'hoge'
|
22
|
+
expected: 'hoge'
|
23
23
|
},
|
24
24
|
{
|
25
25
|
case_no: 3,
|
26
26
|
case_title: 'empty list case',
|
27
27
|
input: [],
|
28
|
-
expected: ''
|
28
|
+
expected: ''
|
29
29
|
},
|
30
30
|
{
|
31
31
|
case_no: 4,
|
32
32
|
case_title: 'each element nil case',
|
33
33
|
input: [nil, nil, nil],
|
34
34
|
expected: "1. \n1. \n1. \n"
|
35
|
-
}
|
35
|
+
}
|
36
36
|
]
|
37
37
|
|
38
38
|
cases.each do |c|
|