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
data/spec/markdown/ul_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: "* \n* \n* \n"
|
35
|
-
}
|
35
|
+
}
|
36
36
|
]
|
37
37
|
|
38
38
|
cases.each do |c|
|
@@ -8,8 +8,8 @@ describe MetasyntacticVariable do
|
|
8
8
|
{
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'valid case',
|
11
|
-
expected: [:foo, :bar, :baz, :qux, :quux, :corge, :grault, :garply, :waldo, :fred, :plugh, :xyzzy, :thud]
|
12
|
-
}
|
11
|
+
expected: [:foo, :bar, :baz, :qux, :quux, :corge, :grault, :garply, :waldo, :fred, :plugh, :xyzzy, :thud]
|
12
|
+
}
|
13
13
|
]
|
14
14
|
|
15
15
|
cases.each do |c|
|
@@ -47,8 +47,8 @@ describe MetasyntacticVariable do
|
|
47
47
|
{
|
48
48
|
case_no: 1,
|
49
49
|
case_title: 'valid case',
|
50
|
-
expected: [:Foo, :Bar, :Baz, :Qux, :Quux, :Corge, :Grault, :Garply, :Waldo, :Fred, :Plugh, :Xyzzy, :Thud]
|
51
|
-
}
|
50
|
+
expected: [:Foo, :Bar, :Baz, :Qux, :Quux, :Corge, :Grault, :Garply, :Waldo, :Fred, :Plugh, :Xyzzy, :Thud]
|
51
|
+
}
|
52
52
|
]
|
53
53
|
|
54
54
|
cases.each do |c|
|
@@ -9,20 +9,20 @@ describe Array do
|
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'numbers(integer) case',
|
11
11
|
input: [*1..6],
|
12
|
-
expected: 3.5
|
12
|
+
expected: 3.5
|
13
13
|
},
|
14
14
|
{
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'numbers(float) case',
|
17
17
|
input: [1.5, 2.5],
|
18
|
-
expected: 2.0
|
18
|
+
expected: 2.0
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: 'not numbers case',
|
23
23
|
input: [*'a'..'z'],
|
24
|
-
expect_error: true
|
25
|
-
}
|
24
|
+
expect_error: true
|
25
|
+
}
|
26
26
|
]
|
27
27
|
|
28
28
|
cases.each do |c|
|
@@ -11,7 +11,7 @@ describe Array do
|
|
11
11
|
input: [*1..6],
|
12
12
|
one_index: 1,
|
13
13
|
other_index: 5,
|
14
|
-
expected: [1, 6, 3, 4, 5, 2]
|
14
|
+
expected: [1, 6, 3, 4, 5, 2]
|
15
15
|
},
|
16
16
|
{
|
17
17
|
case_no: 2,
|
@@ -19,7 +19,7 @@ describe Array do
|
|
19
19
|
input: [*1..6],
|
20
20
|
one_index: 1,
|
21
21
|
other_index: -1,
|
22
|
-
expected: [1, 6, 3, 4, 5, 2]
|
22
|
+
expected: [1, 6, 3, 4, 5, 2]
|
23
23
|
},
|
24
24
|
{
|
25
25
|
case_no: 3,
|
@@ -27,7 +27,7 @@ describe Array do
|
|
27
27
|
input: [*1..6],
|
28
28
|
one_index: 1,
|
29
29
|
other_index: 6,
|
30
|
-
expected: [*1..6]
|
30
|
+
expected: [*1..6]
|
31
31
|
},
|
32
32
|
{
|
33
33
|
case_no: 4,
|
@@ -35,7 +35,7 @@ describe Array do
|
|
35
35
|
input: [*1..6],
|
36
36
|
one_index: 1,
|
37
37
|
other_index: -6,
|
38
|
-
expected: [*1..6]
|
38
|
+
expected: [*1..6]
|
39
39
|
},
|
40
40
|
{
|
41
41
|
case_no: 5,
|
@@ -43,8 +43,8 @@ describe Array do
|
|
43
43
|
input: [],
|
44
44
|
one_index: 1,
|
45
45
|
other_index: 6,
|
46
|
-
expected: []
|
47
|
-
}
|
46
|
+
expected: []
|
47
|
+
}
|
48
48
|
]
|
49
49
|
|
50
50
|
cases.each do |c|
|
@@ -10,7 +10,7 @@ describe Array do
|
|
10
10
|
case_title: 'no args case',
|
11
11
|
input: [*'a'..'c'],
|
12
12
|
method_name: :ord,
|
13
|
-
expected: [97, 98, 99]
|
13
|
+
expected: [97, 98, 99]
|
14
14
|
},
|
15
15
|
{
|
16
16
|
case_no: 3,
|
@@ -18,15 +18,15 @@ describe Array do
|
|
18
18
|
input: [*'aa'..'ac'],
|
19
19
|
method_name: 'gsub',
|
20
20
|
args: ['a', 'c'],
|
21
|
-
expected: ['cc', 'cb', 'cc']
|
21
|
+
expected: ['cc', 'cb', 'cc']
|
22
22
|
},
|
23
23
|
{
|
24
24
|
case_no: 4,
|
25
25
|
case_title: 'have args case',
|
26
26
|
input: [*'aa'..'ac'],
|
27
27
|
method_name: 'to_a',
|
28
|
-
expected: [*'aa'..'ac']
|
29
|
-
}
|
28
|
+
expected: [*'aa'..'ac']
|
29
|
+
}
|
30
30
|
]
|
31
31
|
|
32
32
|
cases.each do |c|
|
@@ -10,7 +10,7 @@ describe Array do
|
|
10
10
|
case_title: 'valid case',
|
11
11
|
inputs: [
|
12
12
|
['header1', 'header2', 'header3'],
|
13
|
-
['line1_1', 'line1_2', 'line1_3']
|
13
|
+
['line1_1', 'line1_2', 'line1_3']
|
14
14
|
],
|
15
15
|
expected: <<-EOS
|
16
16
|
<table>
|
@@ -32,7 +32,7 @@ describe Array do
|
|
32
32
|
case_title: 'no header option case',
|
33
33
|
inputs: [
|
34
34
|
['not_header1', 'not_header2', 'not_header3'],
|
35
|
-
['line1_1', 'line1_2', 'line1_3']
|
35
|
+
['line1_1', 'line1_2', 'line1_3']
|
36
36
|
],
|
37
37
|
options: { no_header: true },
|
38
38
|
expected: <<-EOS
|
@@ -49,7 +49,7 @@ describe Array do
|
|
49
49
|
</tr>
|
50
50
|
</table>
|
51
51
|
EOS
|
52
|
-
}
|
52
|
+
}
|
53
53
|
]
|
54
54
|
|
55
55
|
cases.each do |c|
|
@@ -10,10 +10,10 @@ describe Array do
|
|
10
10
|
case_title: 'valid case',
|
11
11
|
inputs: [
|
12
12
|
['header1', 'header2', 'header3'],
|
13
|
-
['line1_1', 'line1_2', 'line1_3']
|
13
|
+
['line1_1', 'line1_2', 'line1_3']
|
14
14
|
],
|
15
15
|
expected: "|header1|header2|header3|\n|line1_1|line1_2|line1_3|\n"
|
16
|
-
}
|
16
|
+
}
|
17
17
|
]
|
18
18
|
|
19
19
|
cases.each do |c|
|
@@ -11,7 +11,7 @@ describe Array do
|
|
11
11
|
inputs: [[1, 2, 3], %w(one two three)],
|
12
12
|
index: 2,
|
13
13
|
method_name: :together_at,
|
14
|
-
expected: [3, 'three']
|
14
|
+
expected: [3, 'three']\
|
15
15
|
},
|
16
16
|
{
|
17
17
|
case_no: 2,
|
@@ -19,7 +19,7 @@ describe Array do
|
|
19
19
|
inputs: [[1, 2, 3], %w(one two)],
|
20
20
|
index: 2,
|
21
21
|
method_name: :together_at,
|
22
|
-
expected: [3, nil]
|
22
|
+
expected: [3, nil]
|
23
23
|
},
|
24
24
|
{
|
25
25
|
case_no: 3,
|
@@ -27,8 +27,8 @@ describe Array do
|
|
27
27
|
inputs: [[1, 2, 3], %w(one two three)],
|
28
28
|
index: 2,
|
29
29
|
method_name: :tat,
|
30
|
-
expected: [3, 'three']
|
31
|
-
}
|
30
|
+
expected: [3, 'three']
|
31
|
+
}
|
32
32
|
]
|
33
33
|
|
34
34
|
cases.each do |c|
|
@@ -10,15 +10,15 @@ describe Array do
|
|
10
10
|
case_title: 'valid case',
|
11
11
|
inputs: [[1, 2, 3], %w(one two three)],
|
12
12
|
method_name: :together_clear,
|
13
|
-
expected: [[], []]
|
13
|
+
expected: [[], []]
|
14
14
|
},
|
15
15
|
{
|
16
16
|
case_no: 2,
|
17
17
|
case_title: 'valid case',
|
18
18
|
inputs: [[1, 2, 3], %w(one two three)],
|
19
19
|
method_name: :tclear,
|
20
|
-
expected: [[], []]
|
21
|
-
}
|
20
|
+
expected: [[], []]
|
21
|
+
}
|
22
22
|
]
|
23
23
|
|
24
24
|
cases.each do |c|
|
@@ -11,7 +11,7 @@ describe Array do
|
|
11
11
|
inputs: [[1, 2, nil, 3], ['a', 'b', 'c', nil, 'd']],
|
12
12
|
method_name: :together_compact,
|
13
13
|
expected_self: [[1, 2, nil, 3], ['a', 'b', 'c', nil, 'd']],
|
14
|
-
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
14
|
+
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
15
15
|
},
|
16
16
|
{
|
17
17
|
case_no: 2,
|
@@ -19,8 +19,8 @@ describe Array do
|
|
19
19
|
inputs: [[1, 2, nil, 3], ['a', 'b', 'c', nil, 'd']],
|
20
20
|
method_name: :tcompact,
|
21
21
|
expected_self: [[1, 2, nil, 3], ['a', 'b', 'c', nil, 'd']],
|
22
|
-
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
23
|
-
}
|
22
|
+
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
23
|
+
}
|
24
24
|
]
|
25
25
|
|
26
26
|
cases.each do |c|
|
@@ -60,7 +60,7 @@ describe Array do
|
|
60
60
|
inputs: [[1, 2, nil, 3], ['a', 'b', 'c', nil, 'd']],
|
61
61
|
method_name: :together_compact!,
|
62
62
|
expected_self: [[1, 2, 3], ['a', 'b', 'c', 'd']],
|
63
|
-
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
63
|
+
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
64
64
|
},
|
65
65
|
{
|
66
66
|
case_no: 2,
|
@@ -68,8 +68,8 @@ describe Array do
|
|
68
68
|
inputs: [[1, 2, nil, 3], ['a', 'b', 'c', nil, 'd']],
|
69
69
|
method_name: :tcompact!,
|
70
70
|
expected_self: [[1, 2, 3], ['a', 'b', 'c', 'd']],
|
71
|
-
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
72
|
-
}
|
71
|
+
expected_ret: [[1, 2, 3], ['a', 'b', 'c', 'd']]
|
72
|
+
}
|
73
73
|
]
|
74
74
|
|
75
75
|
cases.each do |c|
|
@@ -11,7 +11,7 @@ describe Array do
|
|
11
11
|
inputs: [[1, 2, 3], %w(one two three)],
|
12
12
|
add_list: [4, 5, 6],
|
13
13
|
method_name: :together_concat,
|
14
|
-
expected: [[1, 2, 3, 4, 5, 6], ['one', 'two', 'three', 4, 5, 6]]
|
14
|
+
expected: [[1, 2, 3, 4, 5, 6], ['one', 'two', 'three', 4, 5, 6]]
|
15
15
|
},
|
16
16
|
{
|
17
17
|
case_no: 2,
|
@@ -19,8 +19,8 @@ describe Array do
|
|
19
19
|
inputs: [[1, 2, 3], %w(one two three)],
|
20
20
|
add_list: [4, 5, 6],
|
21
21
|
method_name: :tconcat,
|
22
|
-
expected: [[1, 2, 3, 4, 5, 6], ['one', 'two', 'three', 4, 5, 6]]
|
23
|
-
}
|
22
|
+
expected: [[1, 2, 3, 4, 5, 6], ['one', 'two', 'three', 4, 5, 6]]
|
23
|
+
}
|
24
24
|
]
|
25
25
|
|
26
26
|
cases.each do |c|
|
@@ -12,7 +12,7 @@ describe Array do
|
|
12
12
|
delete_value: 2,
|
13
13
|
method_name: :together_delete_at,
|
14
14
|
expected: [[1, 2, 4], [2, 3, 5]],
|
15
|
-
ret: [3, 4]
|
15
|
+
ret: [3, 4]
|
16
16
|
},
|
17
17
|
{
|
18
18
|
case_no: 2,
|
@@ -21,7 +21,7 @@ describe Array do
|
|
21
21
|
delete_value: 5,
|
22
22
|
method_name: :together_delete_at,
|
23
23
|
expected: [[1, 2, 3, 4], [2, 3, 4, 5]],
|
24
|
-
ret: [nil, nil]
|
24
|
+
ret: [nil, nil]
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 3,
|
@@ -30,7 +30,7 @@ describe Array do
|
|
30
30
|
delete_value: -3,
|
31
31
|
method_name: :together_delete_at,
|
32
32
|
expected: [[1, 3, 4], [2, 4, 5]],
|
33
|
-
ret: [2, 3]
|
33
|
+
ret: [2, 3]
|
34
34
|
},
|
35
35
|
{
|
36
36
|
case_no: 4,
|
@@ -39,8 +39,8 @@ describe Array do
|
|
39
39
|
delete_value: 2,
|
40
40
|
method_name: :tdelete_at,
|
41
41
|
expected: [[1, 2, 4], [2, 3, 5]],
|
42
|
-
ret: [3, 4]
|
43
|
-
}
|
42
|
+
ret: [3, 4]
|
43
|
+
}
|
44
44
|
]
|
45
45
|
|
46
46
|
cases.each do |c|
|
@@ -11,7 +11,7 @@ describe Array do
|
|
11
11
|
inputs: [[1, 2, 3, 4], [6, 4, 6, 8]],
|
12
12
|
delete_block_code: '(first + second).odd?',
|
13
13
|
method_name: :together_delete_if,
|
14
|
-
expected: [[2, 4], [4, 8]]
|
14
|
+
expected: [[2, 4], [4, 8]]
|
15
15
|
},
|
16
16
|
{
|
17
17
|
case_no: 2,
|
@@ -19,7 +19,7 @@ describe Array do
|
|
19
19
|
inputs: [[2, 2, 4, 4], [6, 4, 6, 8]],
|
20
20
|
delete_block_code: '(first + second).odd?',
|
21
21
|
method_name: :together_delete_if,
|
22
|
-
expected: nil
|
22
|
+
expected: nil
|
23
23
|
},
|
24
24
|
{
|
25
25
|
case_no: 3,
|
@@ -27,8 +27,8 @@ describe Array do
|
|
27
27
|
inputs: [[1, 2, 3, 4], [6, 4, 6, 8]],
|
28
28
|
delete_block_code: '(first + second).odd?',
|
29
29
|
method_name: :tdelete_if,
|
30
|
-
expected: [[2, 4], [4, 8]]
|
31
|
-
}
|
30
|
+
expected: [[2, 4], [4, 8]]
|
31
|
+
}
|
32
32
|
]
|
33
33
|
|
34
34
|
cases.each do |c|
|
@@ -12,7 +12,7 @@ describe Array do
|
|
12
12
|
delete_value: 2,
|
13
13
|
method_name: :together_delete,
|
14
14
|
expected: [[1, 3, 4], [3, 4, 5]],
|
15
|
-
ret: 2
|
15
|
+
ret: 2
|
16
16
|
},
|
17
17
|
{
|
18
18
|
case_no: 2,
|
@@ -23,7 +23,7 @@ describe Array do
|
|
23
23
|
expected: [[1, 2, 3, 4], [2, 3, 4, 5]],
|
24
24
|
ret: :ret,
|
25
25
|
has_block: true,
|
26
|
-
block: :ret
|
26
|
+
block: :ret
|
27
27
|
},
|
28
28
|
{
|
29
29
|
case_no: 3,
|
@@ -32,7 +32,7 @@ describe Array do
|
|
32
32
|
delete_value: 6,
|
33
33
|
method_name: :together_delete,
|
34
34
|
expected: [[1, 2, 3, 4], [2, 3, 4, 5]],
|
35
|
-
ret: nil
|
35
|
+
ret: nil
|
36
36
|
},
|
37
37
|
{
|
38
38
|
case_no: 4,
|
@@ -41,8 +41,8 @@ describe Array do
|
|
41
41
|
delete_value: 2,
|
42
42
|
method_name: :tdelete,
|
43
43
|
expected: [[1, 3, 4], [3, 4, 5]],
|
44
|
-
ret: 2
|
45
|
-
}
|
44
|
+
ret: 2
|
45
|
+
}
|
46
46
|
]
|
47
47
|
|
48
48
|
cases.each do |c|
|
@@ -10,22 +10,22 @@ describe Array do
|
|
10
10
|
case_title: 'empty case',
|
11
11
|
inputs: [[], []],
|
12
12
|
method_name: :together_empty?,
|
13
|
-
expected: true
|
13
|
+
expected: true
|
14
14
|
},
|
15
15
|
{
|
16
16
|
case_no: 2,
|
17
17
|
case_title: 'not empty case',
|
18
18
|
inputs: [[1], []],
|
19
19
|
method_name: :together_empty?,
|
20
|
-
expected: false
|
20
|
+
expected: false
|
21
21
|
},
|
22
22
|
{
|
23
23
|
case_no: 3,
|
24
24
|
case_title: 'empty case(alias tempty?)',
|
25
25
|
inputs: [[], []],
|
26
26
|
method_name: :tempty?,
|
27
|
-
expected: true
|
28
|
-
}
|
27
|
+
expected: true
|
28
|
+
}
|
29
29
|
]
|
30
30
|
|
31
31
|
cases.each do |c|
|
@@ -12,7 +12,7 @@ describe Array do
|
|
12
12
|
fill_value: 99,
|
13
13
|
method_name: :together_fill,
|
14
14
|
expected: [[99, 99, 99, 99, 99], [99, 99, 99, 99, 99]],
|
15
|
-
has_block: false
|
15
|
+
has_block: false
|
16
16
|
},
|
17
17
|
{
|
18
18
|
case_no: 2,
|
@@ -22,7 +22,7 @@ describe Array do
|
|
22
22
|
method_name: :together_fill,
|
23
23
|
expected: [[2, 3, 4, 5, 6], [2, 3, 4, 5, 6]],
|
24
24
|
block_logic: '(i + 1) + 1',
|
25
|
-
has_block: true
|
25
|
+
has_block: true
|
26
26
|
},
|
27
27
|
{
|
28
28
|
case_no: 3,
|
@@ -32,7 +32,7 @@ describe Array do
|
|
32
32
|
method_name: :together_fill,
|
33
33
|
expected: [[1, 2, 4, 5, 6], [6, 7, 4, 5, 6]],
|
34
34
|
block_logic: '(i + 1) + 1',
|
35
|
-
has_block: true
|
35
|
+
has_block: true
|
36
36
|
},
|
37
37
|
{
|
38
38
|
case_no: 4,
|
@@ -41,8 +41,8 @@ describe Array do
|
|
41
41
|
fill_value: 99,
|
42
42
|
method_name: :tfill,
|
43
43
|
expected: [[99, 99, 99, 99, 99], [99, 99, 99, 99, 99]],
|
44
|
-
has_block: false
|
45
|
-
}
|
44
|
+
has_block: false
|
45
|
+
}
|
46
46
|
]
|
47
47
|
|
48
48
|
cases.each do |c|
|