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
@@ -36,7 +36,7 @@ describe AttrEnumerable do
|
|
36
36
|
),
|
37
37
|
method: :include_name?,
|
38
38
|
value: 'tanaka',
|
39
|
-
expected: true
|
39
|
+
expected: true
|
40
40
|
},
|
41
41
|
{
|
42
42
|
case_no: 2,
|
@@ -50,7 +50,7 @@ describe AttrEnumerable do
|
|
50
50
|
),
|
51
51
|
method: :include_age?,
|
52
52
|
value: 84,
|
53
|
-
expected: true
|
53
|
+
expected: true
|
54
54
|
},
|
55
55
|
{
|
56
56
|
case_no: 3,
|
@@ -64,7 +64,7 @@ describe AttrEnumerable do
|
|
64
64
|
),
|
65
65
|
method: :include_name?,
|
66
66
|
value: 'sato',
|
67
|
-
expected: false
|
67
|
+
expected: false
|
68
68
|
},
|
69
69
|
{
|
70
70
|
case_no: 4,
|
@@ -72,7 +72,7 @@ describe AttrEnumerable do
|
|
72
72
|
klass: AttrEnumerablePersons.new([]),
|
73
73
|
method: :include_name?,
|
74
74
|
value: 'tanaka',
|
75
|
-
expected: false
|
75
|
+
expected: false
|
76
76
|
}
|
77
77
|
]
|
78
78
|
|
@@ -36,7 +36,7 @@ describe AttrEnumerable do
|
|
36
36
|
),
|
37
37
|
method: :last_name,
|
38
38
|
last: nil,
|
39
|
-
expected: ['suzuki']
|
39
|
+
expected: ['suzuki']
|
40
40
|
},
|
41
41
|
{
|
42
42
|
case_no: 2,
|
@@ -50,7 +50,7 @@ describe AttrEnumerable do
|
|
50
50
|
),
|
51
51
|
method: :last_age,
|
52
52
|
last: 2,
|
53
|
-
expected: [20, 20]
|
53
|
+
expected: [20, 20]
|
54
54
|
},
|
55
55
|
{
|
56
56
|
case_no: 3,
|
@@ -64,7 +64,7 @@ describe AttrEnumerable do
|
|
64
64
|
),
|
65
65
|
method: :last_age,
|
66
66
|
last: 4,
|
67
|
-
expected: [20, 20, 84]
|
67
|
+
expected: [20, 20, 84]
|
68
68
|
},
|
69
69
|
{
|
70
70
|
case_no: 4,
|
@@ -72,7 +72,7 @@ describe AttrEnumerable do
|
|
72
72
|
klass: AttrEnumerablePersons.new([]),
|
73
73
|
method: :last_name,
|
74
74
|
last: nil,
|
75
|
-
expected: []
|
75
|
+
expected: []
|
76
76
|
}
|
77
77
|
]
|
78
78
|
|
@@ -36,7 +36,7 @@ describe AttrEnumerable do
|
|
36
36
|
),
|
37
37
|
method: :map_name,
|
38
38
|
block: lambda { |x|x.upcase },
|
39
|
-
expected: ['TANAKA'
|
39
|
+
expected: ['TANAKA', 'TANAKA', 'SUZUKI']
|
40
40
|
},
|
41
41
|
{
|
42
42
|
case_no: 2,
|
@@ -50,7 +50,7 @@ describe AttrEnumerable do
|
|
50
50
|
),
|
51
51
|
method: :map_age,
|
52
52
|
block: lambda { |x|x += 1 },
|
53
|
-
expected: [85, 21, 21]
|
53
|
+
expected: [85, 21, 21]
|
54
54
|
},
|
55
55
|
{
|
56
56
|
case_no: 3,
|
@@ -58,7 +58,7 @@ describe AttrEnumerable do
|
|
58
58
|
klass: AttrEnumerablePersons.new([]),
|
59
59
|
method: :map_name,
|
60
60
|
block: lambda { |x|x += 1 },
|
61
|
-
expected: []
|
61
|
+
expected: []
|
62
62
|
}
|
63
63
|
]
|
64
64
|
|
@@ -36,7 +36,7 @@ describe AttrEnumerable do
|
|
36
36
|
),
|
37
37
|
method: :reduce_name,
|
38
38
|
block: lambda { |r, x|r ||= ''; r = "#{r}#{x.upcase}"; r },
|
39
|
-
expected: '0TANAKATANAKASUZUKI'
|
39
|
+
expected: '0TANAKATANAKASUZUKI'
|
40
40
|
},
|
41
41
|
{
|
42
42
|
case_no: 2,
|
@@ -50,7 +50,7 @@ describe AttrEnumerable do
|
|
50
50
|
),
|
51
51
|
method: :reduce_age,
|
52
52
|
block: lambda { |r, x|r ||= 0; r += x + 1; r },
|
53
|
-
expected: 127
|
53
|
+
expected: 127
|
54
54
|
},
|
55
55
|
{
|
56
56
|
case_no: 3,
|
@@ -58,7 +58,7 @@ describe AttrEnumerable do
|
|
58
58
|
klass: AttrEnumerablePersons.new([]),
|
59
59
|
method: :reduce_name,
|
60
60
|
block: lambda { |x|x += 1 },
|
61
|
-
expected: 0
|
61
|
+
expected: 0
|
62
62
|
}
|
63
63
|
]
|
64
64
|
|
@@ -37,7 +37,7 @@ describe AttrEnumerable do
|
|
37
37
|
method: :sample_name,
|
38
38
|
count: 2,
|
39
39
|
expected_array: ['tanaka', 'suzuki'],
|
40
|
-
expected_size: 2
|
40
|
+
expected_size: 2
|
41
41
|
},
|
42
42
|
{
|
43
43
|
case_no: 2,
|
@@ -52,8 +52,8 @@ describe AttrEnumerable do
|
|
52
52
|
method: :sample_age,
|
53
53
|
count: nil,
|
54
54
|
expected_array: [84, 20],
|
55
|
-
expected_size: 1
|
56
|
-
}
|
55
|
+
expected_size: 1
|
56
|
+
}
|
57
57
|
]
|
58
58
|
|
59
59
|
cases.each do |c|
|
@@ -36,7 +36,7 @@ describe AttrEnumerable do
|
|
36
36
|
),
|
37
37
|
method: :select_name,
|
38
38
|
block: proc { |v|v == 'tanaka' },
|
39
|
-
expected: ['tanaka', 'tanaka']
|
39
|
+
expected: ['tanaka', 'tanaka']
|
40
40
|
},
|
41
41
|
{
|
42
42
|
case_no: 2,
|
@@ -50,7 +50,7 @@ describe AttrEnumerable do
|
|
50
50
|
),
|
51
51
|
method: :select_age,
|
52
52
|
block: proc { |v|v == 20 },
|
53
|
-
expected: [20, 20]
|
53
|
+
expected: [20, 20]
|
54
54
|
}
|
55
55
|
]
|
56
56
|
|
@@ -16,13 +16,13 @@ describe AttributesInitializable do
|
|
16
16
|
klass: AccessorAccessorSample,
|
17
17
|
inputs: {
|
18
18
|
atr1: 'atr1',
|
19
|
-
atr2: 'atr2'
|
19
|
+
atr2: 'atr2'
|
20
20
|
},
|
21
21
|
block: false,
|
22
22
|
expected: {
|
23
23
|
atr1: 'atr1',
|
24
|
-
atr2: 'atr2'
|
25
|
-
}
|
24
|
+
atr2: 'atr2'
|
25
|
+
}
|
26
26
|
},
|
27
27
|
{
|
28
28
|
case_no: 2,
|
@@ -30,14 +30,14 @@ describe AttributesInitializable do
|
|
30
30
|
klass: AccessorAccessorSample,
|
31
31
|
inputs: {
|
32
32
|
atr1: 'atr1',
|
33
|
-
atr2: 'atr2'
|
33
|
+
atr2: 'atr2'
|
34
34
|
},
|
35
35
|
block: true,
|
36
36
|
expected: {
|
37
37
|
atr1: 'atr1',
|
38
|
-
atr2: 'atr2'
|
39
|
-
}
|
40
|
-
}
|
38
|
+
atr2: 'atr2'
|
39
|
+
}
|
40
|
+
}
|
41
41
|
]
|
42
42
|
|
43
43
|
cases.each do |c|
|
@@ -91,13 +91,13 @@ describe AttributesInitializable do
|
|
91
91
|
klass: ReaderSample,
|
92
92
|
inputs: {
|
93
93
|
atr1: 'atr1',
|
94
|
-
atr2: 'atr2'
|
94
|
+
atr2: 'atr2'
|
95
95
|
},
|
96
96
|
block: false,
|
97
97
|
expected: {
|
98
98
|
atr1: 'atr1',
|
99
|
-
atr2: 'atr2'
|
100
|
-
}
|
99
|
+
atr2: 'atr2'
|
100
|
+
}
|
101
101
|
},
|
102
102
|
{
|
103
103
|
case_no: 2,
|
@@ -105,14 +105,14 @@ describe AttributesInitializable do
|
|
105
105
|
klass: ReaderSample,
|
106
106
|
inputs: {
|
107
107
|
atr1: 'atr1',
|
108
|
-
atr2: 'atr2'
|
108
|
+
atr2: 'atr2'
|
109
109
|
},
|
110
110
|
block: true,
|
111
111
|
expected: {
|
112
112
|
atr1: 'atr1',
|
113
|
-
atr2: 'atr2'
|
114
|
-
}
|
115
|
-
}
|
113
|
+
atr2: 'atr2'
|
114
|
+
}
|
115
|
+
}
|
116
116
|
]
|
117
117
|
|
118
118
|
cases.each do |c|
|
@@ -170,13 +170,13 @@ describe AttributesInitializable do
|
|
170
170
|
klass: WriterSample,
|
171
171
|
inputs: {
|
172
172
|
atr1: 'atr1',
|
173
|
-
atr2: 'atr2'
|
173
|
+
atr2: 'atr2'
|
174
174
|
},
|
175
175
|
block: false,
|
176
176
|
expected: {
|
177
177
|
atr1: 'atr1',
|
178
|
-
atr2: 'atr2'
|
179
|
-
}
|
178
|
+
atr2: 'atr2'
|
179
|
+
}
|
180
180
|
},
|
181
181
|
{
|
182
182
|
case_no: 2,
|
@@ -184,14 +184,14 @@ describe AttributesInitializable do
|
|
184
184
|
klass: WriterSample,
|
185
185
|
inputs: {
|
186
186
|
atr1: 'atr1',
|
187
|
-
atr2: 'atr2'
|
187
|
+
atr2: 'atr2'
|
188
188
|
},
|
189
189
|
block: true,
|
190
190
|
expected: {
|
191
191
|
atr1: 'atr1',
|
192
|
-
atr2: 'atr2'
|
193
|
-
}
|
194
|
-
}
|
192
|
+
atr2: 'atr2'
|
193
|
+
}
|
194
|
+
}
|
195
195
|
]
|
196
196
|
|
197
197
|
cases.each do |c|
|
@@ -17,7 +17,7 @@ describe 'EvalHelper' do
|
|
17
17
|
case_title: 'valid case',
|
18
18
|
target: '[:a, :b]',
|
19
19
|
proc: "puts \"\#{v}1\"\nputs \"\#{v}2\"\n",
|
20
|
-
expected: "[:a, :b].each do |v|\n puts \"\#{v}1\"\n puts \"\#{v}2\"\nend"
|
20
|
+
expected: "[:a, :b].each do |v|\n puts \"\#{v}1\"\n puts \"\#{v}2\"\nend"
|
21
21
|
}
|
22
22
|
]
|
23
23
|
|
@@ -17,8 +17,8 @@ describe 'EvalHelper' do
|
|
17
17
|
case_title: 'unless case',
|
18
18
|
target: '[:a, :b]',
|
19
19
|
proc: 'puts "#{i}:#{v}"',
|
20
|
-
expected: '[:a, :b].each_with_index { |v, i|puts "#{i}:#{v}" }'
|
21
|
-
}
|
20
|
+
expected: '[:a, :b].each_with_index { |v, i|puts "#{i}:#{v}" }'
|
21
|
+
}
|
22
22
|
]
|
23
23
|
|
24
24
|
cases.each do |c|
|
@@ -17,8 +17,8 @@ describe 'EvalHelper' do
|
|
17
17
|
case_title: 'valid case',
|
18
18
|
target: '[:a, :b]',
|
19
19
|
proc: "puts \"\#{i}:\#{v}1\"\nputs \"\#{i}:\#{v}2\"\n",
|
20
|
-
expected: "[:a, :b].each_with_index do |v, i|\n puts \"\#{i}:\#{v}1\"\n puts \"\#{i}:\#{v}2\"\nend"
|
21
|
-
}
|
20
|
+
expected: "[:a, :b].each_with_index do |v, i|\n puts \"\#{i}:\#{v}1\"\n puts \"\#{i}:\#{v}2\"\nend"
|
21
|
+
}
|
22
22
|
]
|
23
23
|
|
24
24
|
cases.each do |c|
|
@@ -22,7 +22,7 @@ describe 'EvalHelper' do
|
|
22
22
|
input: 'test',
|
23
23
|
if_cond: "msg == 'test'",
|
24
24
|
if_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: 'not_test',
|
31
31
|
if_cond: "msg == 'test'",
|
32
32
|
if_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
|
if_cond: "msg == 'test'",
|
22
22
|
if_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
|
if_cond: "msg == 'test'",
|
31
31
|
if_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|
|
@@ -16,14 +16,14 @@ describe 'EvalHelper' do
|
|
16
16
|
case_no: 1,
|
17
17
|
case_title: 'single require case',
|
18
18
|
inputs: 'tbpgr_utils',
|
19
|
-
expected: "require 'tbpgr_utils'\n"
|
19
|
+
expected: "require 'tbpgr_utils'\n"
|
20
20
|
},
|
21
21
|
{
|
22
22
|
case_no: 2,
|
23
23
|
case_title: 'multi require case',
|
24
24
|
inputs: ['tbpgr_utils', 'eval_helper'],
|
25
|
-
expected: "require 'tbpgr_utils'\nrequire 'eval_helper'\n"
|
26
|
-
}
|
25
|
+
expected: "require 'tbpgr_utils'\nrequire 'eval_helper'\n"
|
26
|
+
}
|
27
27
|
]
|
28
28
|
|
29
29
|
cases.each do |c|
|
@@ -16,14 +16,14 @@ describe 'EvalHelper' do
|
|
16
16
|
case_no: 1,
|
17
17
|
case_title: 'single require case',
|
18
18
|
inputs: 'tbpgr_utils',
|
19
|
-
expected: "require_relative 'tbpgr_utils'\n"
|
19
|
+
expected: "require_relative 'tbpgr_utils'\n"
|
20
20
|
},
|
21
21
|
{
|
22
22
|
case_no: 2,
|
23
23
|
case_title: 'multi require case',
|
24
24
|
inputs: ['tbpgr_utils', 'eval_helper'],
|
25
|
-
expected: "require_relative 'tbpgr_utils'\nrequire_relative 'eval_helper'\n"
|
26
|
-
}
|
25
|
+
expected: "require_relative 'tbpgr_utils'\nrequire_relative 'eval_helper'\n"
|
26
|
+
}
|
27
27
|
]
|
28
28
|
|
29
29
|
cases.each do |c|
|