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
@@ -24,36 +24,36 @@ describe Object do
|
|
24
24
|
case_title: 'String case',
|
25
25
|
search: 'public_method1',
|
26
26
|
all: false,
|
27
|
-
expected: [:public_method1]
|
27
|
+
expected: [:public_method1]
|
28
28
|
},
|
29
29
|
{
|
30
30
|
case_no: 2,
|
31
31
|
case_title: 'Symbol case',
|
32
32
|
search: :public_method1,
|
33
33
|
all: false,
|
34
|
-
expected: [:public_method1]
|
34
|
+
expected: [:public_method1]
|
35
35
|
},
|
36
36
|
{
|
37
37
|
case_no: 3,
|
38
38
|
case_title: 'Regexp case',
|
39
39
|
search: /public_method1/,
|
40
40
|
all: false,
|
41
|
-
expected: [:public_method1, :public_method11]
|
41
|
+
expected: [:public_method1, :public_method11]
|
42
42
|
},
|
43
43
|
{
|
44
44
|
case_no: 4,
|
45
45
|
case_title: 'not hit case',
|
46
46
|
search: /public_method3/,
|
47
47
|
all: false,
|
48
|
-
expected: []
|
48
|
+
expected: []
|
49
49
|
},
|
50
50
|
{
|
51
51
|
case_no: 5,
|
52
52
|
case_title: 'all case',
|
53
53
|
search: :__send__,
|
54
54
|
all: true,
|
55
|
-
expected: [:__send__]
|
56
|
-
}
|
55
|
+
expected: [:__send__]
|
56
|
+
}
|
57
57
|
]
|
58
58
|
|
59
59
|
cases.each do |c|
|
@@ -21,14 +21,14 @@ describe Object do
|
|
21
21
|
case_title: 'gard return case',
|
22
22
|
input: true,
|
23
23
|
action: "return 'guard!!'",
|
24
|
-
expected: 'guard!!'
|
24
|
+
expected: 'guard!!'
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 2,
|
28
28
|
case_title: 'not gard return case',
|
29
29
|
input: false,
|
30
30
|
action: "return 'guard!!'",
|
31
|
-
expected: 'not guard return'
|
31
|
+
expected: 'not guard return'
|
32
32
|
},
|
33
33
|
{
|
34
34
|
case_no: 3,
|
@@ -44,8 +44,8 @@ describe Object do
|
|
44
44
|
input: false,
|
45
45
|
action: "fail ArgumentError, 'error!!'",
|
46
46
|
fail: true,
|
47
|
-
expected: 'not guard fail'
|
48
|
-
}
|
47
|
+
expected: 'not guard fail'
|
48
|
+
}
|
49
49
|
]
|
50
50
|
|
51
51
|
cases.each do |c|
|
@@ -106,14 +106,14 @@ describe Object do
|
|
106
106
|
case_title: 'unless_gard return case',
|
107
107
|
input: false,
|
108
108
|
action: "return 'unless_guard!!'",
|
109
|
-
expected: 'unless_guard!!'
|
109
|
+
expected: 'unless_guard!!'
|
110
110
|
},
|
111
111
|
{
|
112
112
|
case_no: 2,
|
113
113
|
case_title: 'not unless_gard return case',
|
114
114
|
input: true,
|
115
115
|
action: "return 'unless_guard!!'",
|
116
|
-
expected: 'not unless_guard return'
|
116
|
+
expected: 'not unless_guard return'
|
117
117
|
},
|
118
118
|
{
|
119
119
|
case_no: 3,
|
@@ -129,8 +129,8 @@ describe Object do
|
|
129
129
|
input: true,
|
130
130
|
action: "fail ArgumentError, 'error!!'",
|
131
131
|
fail: true,
|
132
|
-
expected: 'not unless_guard fail'
|
133
|
-
}
|
132
|
+
expected: 'not unless_guard fail'
|
133
|
+
}
|
134
134
|
]
|
135
135
|
|
136
136
|
cases.each do |c|
|
@@ -9,20 +9,20 @@ describe Object do
|
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'String case',
|
11
11
|
input: 'string',
|
12
|
-
expected: true
|
12
|
+
expected: true
|
13
13
|
},
|
14
14
|
{
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'Symbol case',
|
17
17
|
input: :symbol,
|
18
|
-
expected: true
|
18
|
+
expected: true
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: 'other case',
|
23
23
|
input: 1,
|
24
|
-
expected: false
|
25
|
-
}
|
24
|
+
expected: false
|
25
|
+
}
|
26
26
|
]
|
27
27
|
|
28
28
|
cases.each do |c|
|
@@ -9,38 +9,38 @@ describe Object do
|
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'TrueClass case',
|
11
11
|
input: true,
|
12
|
-
expected: true
|
12
|
+
expected: true
|
13
13
|
},
|
14
14
|
{
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'FalseClass case',
|
17
17
|
input: false,
|
18
|
-
expected: false
|
18
|
+
expected: false
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: "string 'true' case",
|
23
23
|
input: 'true',
|
24
|
-
expected: true
|
24
|
+
expected: true
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 4,
|
28
28
|
case_title: "string 'false' case",
|
29
29
|
input: 'false',
|
30
|
-
expected: true
|
30
|
+
expected: true
|
31
31
|
},
|
32
32
|
{
|
33
33
|
case_no: 5,
|
34
34
|
case_title: 'empty case',
|
35
35
|
input: '',
|
36
|
-
expected: true
|
36
|
+
expected: true
|
37
37
|
},
|
38
38
|
{
|
39
39
|
case_no: 6,
|
40
40
|
case_title: 'nil case',
|
41
41
|
input: nil,
|
42
|
-
expected: false
|
43
|
-
}
|
42
|
+
expected: false
|
43
|
+
}
|
44
44
|
]
|
45
45
|
|
46
46
|
cases.each do |c|
|
@@ -9,26 +9,26 @@ describe String do
|
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'only ascii case',
|
11
11
|
input: 'abc',
|
12
|
-
expected: 3
|
12
|
+
expected: 3
|
13
13
|
},
|
14
14
|
{
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'only other case',
|
17
17
|
input: 'abc',
|
18
|
-
expected: 6
|
18
|
+
expected: 6
|
19
19
|
},
|
20
20
|
{
|
21
21
|
case_no: 3,
|
22
22
|
case_title: 'mix case',
|
23
23
|
input: 'aabbcc',
|
24
|
-
expected: 9
|
24
|
+
expected: 9
|
25
25
|
},
|
26
26
|
{
|
27
27
|
case_no: 4,
|
28
28
|
case_title: 'han-kana case',
|
29
29
|
input: 'アン',
|
30
|
-
expected: 2
|
31
|
-
}
|
30
|
+
expected: 2
|
31
|
+
}
|
32
32
|
]
|
33
33
|
|
34
34
|
cases.each do |c|
|
@@ -9,14 +9,14 @@ describe String do
|
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'file case',
|
11
11
|
input: '/cygdrive/c/hoge/hoge.txt',
|
12
|
-
expected: 'C:\hoge\hoge.txt'
|
12
|
+
expected: 'C:\hoge\hoge.txt'
|
13
13
|
},
|
14
14
|
{
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'dir case',
|
17
17
|
input: '/cygdrive/d/hoge',
|
18
|
-
expected: 'D:\hoge'
|
19
|
-
}
|
18
|
+
expected: 'D:\hoge'
|
19
|
+
}
|
20
20
|
]
|
21
21
|
|
22
22
|
cases.each do |c|
|
@@ -9,14 +9,14 @@ describe String do
|
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'exist double quote case',
|
11
11
|
input: 'hoge"h"ige',
|
12
|
-
expected: 'hoge""h""ige'
|
12
|
+
expected: 'hoge""h""ige'
|
13
13
|
},
|
14
14
|
{
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'not exist double quote case',
|
17
17
|
input: 'hogehige',
|
18
|
-
expected: 'hogehige'
|
19
|
-
}
|
18
|
+
expected: 'hogehige'
|
19
|
+
}
|
20
20
|
]
|
21
21
|
|
22
22
|
cases.each do |c|
|
@@ -9,14 +9,14 @@ describe String do
|
|
9
9
|
case_no: 1,
|
10
10
|
case_title: 'exist quote case',
|
11
11
|
input: "hoge'h'ige",
|
12
|
-
expected: "hoge''h''ige"
|
12
|
+
expected: "hoge''h''ige"
|
13
13
|
},
|
14
14
|
{
|
15
15
|
case_no: 2,
|
16
16
|
case_title: 'not exist quote case',
|
17
17
|
input: 'hogehige',
|
18
|
-
expected: 'hogehige'
|
19
|
-
}
|
18
|
+
expected: 'hogehige'
|
19
|
+
}
|
20
20
|
]
|
21
21
|
|
22
22
|
cases.each do |c|
|
@@ -10,7 +10,7 @@ describe String do
|
|
10
10
|
case_title: 'no args case',
|
11
11
|
input: 'abc',
|
12
12
|
method_name: 'next',
|
13
|
-
expected: 'bcd'
|
13
|
+
expected: 'bcd'
|
14
14
|
},
|
15
15
|
{
|
16
16
|
case_no: 2,
|
@@ -18,8 +18,8 @@ describe String do
|
|
18
18
|
input: 'abc',
|
19
19
|
method_name: '+',
|
20
20
|
args: ['d'],
|
21
|
-
expected: 'adbdcd'
|
22
|
-
}
|
21
|
+
expected: 'adbdcd'
|
22
|
+
}
|
23
23
|
]
|
24
24
|
|
25
25
|
cases.each do |c|
|
@@ -34,7 +34,7 @@ describe String do
|
|
34
34
|
case_title: 'empty case',
|
35
35
|
input: '',
|
36
36
|
expected: false
|
37
|
-
}
|
37
|
+
}
|
38
38
|
]
|
39
39
|
|
40
40
|
cases.each do |c|
|
@@ -47,10 +47,10 @@ describe String do
|
|
47
47
|
|
48
48
|
# -- when --
|
49
49
|
if c[:expect_error]
|
50
|
-
lambda { c[:input].
|
50
|
+
lambda { c[:input].meta_variable?(c[:option]) }.should raise_error(StandardError)
|
51
51
|
next
|
52
52
|
end
|
53
|
-
actual = c[:option] ? c[:input].
|
53
|
+
actual = c[:option] ? c[:input].meta_variable?(c[:option]) : c[:input].meta_variable?
|
54
54
|
|
55
55
|
# -- then --
|
56
56
|
expect(actual).to eq(c[:expected])
|
@@ -60,13 +60,13 @@ print 'hoge' + 'hige' # => 'hogehige'
|
|
60
60
|
input: SAMPLE_STRING1,
|
61
61
|
separator: '#',
|
62
62
|
position: :left,
|
63
|
-
expected: SAMPLE_JUSTIFIED_STRING1
|
63
|
+
expected: SAMPLE_JUSTIFIED_STRING1
|
64
64
|
},
|
65
65
|
{
|
66
66
|
case_no: 2,
|
67
67
|
case_title: 'use default separator(pipe) justify case',
|
68
68
|
input: SAMPLE_STRING2,
|
69
|
-
expected: SAMPLE_JUSTIFIED_STRING2
|
69
|
+
expected: SAMPLE_JUSTIFIED_STRING2
|
70
70
|
},
|
71
71
|
{
|
72
72
|
case_no: 3,
|
@@ -74,7 +74,7 @@ print 'hoge' + 'hige' # => 'hogehige'
|
|
74
74
|
input: SAMPLE_STRING3,
|
75
75
|
separator: '//',
|
76
76
|
position: :left,
|
77
|
-
expected: SAMPLE_JUSTIFIED_STRING3
|
77
|
+
expected: SAMPLE_JUSTIFIED_STRING3
|
78
78
|
},
|
79
79
|
{
|
80
80
|
case_no: 4,
|
@@ -82,7 +82,7 @@ print 'hoge' + 'hige' # => 'hogehige'
|
|
82
82
|
input: SAMPLE_STRING1,
|
83
83
|
separator: '#',
|
84
84
|
position: :right,
|
85
|
-
expected: SAMPLE_JUSTIFIED_STRING4
|
85
|
+
expected: SAMPLE_JUSTIFIED_STRING4
|
86
86
|
},
|
87
87
|
{
|
88
88
|
case_no: 5,
|
@@ -90,8 +90,8 @@ print 'hoge' + 'hige' # => 'hogehige'
|
|
90
90
|
input: SAMPLE_STRING1,
|
91
91
|
separator: '#',
|
92
92
|
position: :center,
|
93
|
-
expected: SAMPLE_JUSTIFIED_STRING5
|
94
|
-
}
|
93
|
+
expected: SAMPLE_JUSTIFIED_STRING5
|
94
|
+
}
|
95
95
|
]
|
96
96
|
|
97
97
|
cases.each do |c|
|
@@ -50,33 +50,33 @@ csv_column2_1, csv_column2_2
|
|
50
50
|
case_no: 1,
|
51
51
|
case_title: 'valid justify case',
|
52
52
|
input: SAMPLE_TABLE,
|
53
|
-
expected: SAMPLE_JUSTIFIED_TABLE
|
53
|
+
expected: SAMPLE_JUSTIFIED_TABLE
|
54
54
|
},
|
55
55
|
{
|
56
56
|
case_no: 2,
|
57
57
|
case_title: 'not table case',
|
58
58
|
input: SAMPLE_NOT_TABLE,
|
59
|
-
expected: SAMPLE_NOT_TABLE
|
59
|
+
expected: SAMPLE_NOT_TABLE
|
60
60
|
},
|
61
61
|
{
|
62
62
|
case_no: 3,
|
63
63
|
case_title: 'empty case',
|
64
64
|
input: '',
|
65
|
-
expected: ''
|
65
|
+
expected: ''
|
66
66
|
},
|
67
67
|
{
|
68
68
|
case_no: 4,
|
69
69
|
case_title: 'ascii/other code mix valid justify case',
|
70
70
|
input: SAMPLE_TABLE4,
|
71
|
-
expected: SAMPLE_JUSTIFIED_TABLE4
|
71
|
+
expected: SAMPLE_JUSTIFIED_TABLE4
|
72
72
|
},
|
73
73
|
{
|
74
74
|
case_no: 5,
|
75
75
|
case_title: 'ascii/other code mix valid justify case(right)',
|
76
76
|
input: SAMPLE_TABLE4,
|
77
77
|
position: :right,
|
78
|
-
expected: SAMPLE_JUSTIFIED_TABLE5
|
79
|
-
}
|
78
|
+
expected: SAMPLE_JUSTIFIED_TABLE5
|
79
|
+
}
|
80
80
|
]
|
81
81
|
|
82
82
|
cases.each do |c|
|