libpath-ruby 0.2.2 → 0.2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +33 -0
  3. data/README.md +25 -8
  4. data/examples/path_from_arg0.md +43 -43
  5. data/examples/path_from_arg0.rb +25 -23
  6. data/lib/libpath/constants/unix.rb +74 -74
  7. data/lib/libpath/constants/windows.rb +75 -75
  8. data/lib/libpath/constants.rb +20 -20
  9. data/lib/libpath/diagnostics/parameter_checking.rb +27 -26
  10. data/lib/libpath/diagnostics.rb +1 -1
  11. data/lib/libpath/exceptions/libpath_base_exception.rb +20 -21
  12. data/lib/libpath/exceptions/malformed_name_exception.rb +27 -27
  13. data/lib/libpath/exceptions.rb +1 -1
  14. data/lib/libpath/form/unix.rb +118 -118
  15. data/lib/libpath/form/windows.rb +228 -214
  16. data/lib/libpath/form.rb +20 -21
  17. data/lib/libpath/internal_/array.rb +57 -57
  18. data/lib/libpath/internal_/platform.rb +30 -31
  19. data/lib/libpath/internal_/string.rb +25 -20
  20. data/lib/libpath/internal_/unix/form.rb +124 -119
  21. data/lib/libpath/internal_/windows/drive.rb +80 -75
  22. data/lib/libpath/internal_/windows/form.rb +205 -194
  23. data/lib/libpath/libpath.rb +4 -1
  24. data/lib/libpath/path/unix.rb +120 -118
  25. data/lib/libpath/path/windows.rb +126 -124
  26. data/lib/libpath/path.rb +21 -21
  27. data/lib/libpath/util/unix.rb +261 -261
  28. data/lib/libpath/util/windows.rb +403 -403
  29. data/lib/libpath/util.rb +20 -20
  30. data/lib/libpath/version.rb +25 -26
  31. data/lib/libpath.rb +1 -1
  32. data/test/performance/benchmark_drive_letter.rb +50 -10
  33. data/test/performance/benchmark_gsub_string_or_regex.rb +27 -23
  34. data/test/performance/benchmark_rindex2.rb +56 -48
  35. data/test/performance/benchmark_split.rb +16 -10
  36. data/test/unit/compare/ts_all.rb +4 -4
  37. data/test/unit/equate/ts_all.rb +4 -4
  38. data/test/unit/equate/unix/ts_all.rb +4 -4
  39. data/test/unit/equate/windows/ts_all.rb +4 -4
  40. data/test/unit/exceptions/tc_libpath_base_exception.rb +10 -8
  41. data/test/unit/exceptions/tc_malformed_name_exception.rb +14 -12
  42. data/test/unit/exceptions/ts_all.rb +4 -4
  43. data/test/unit/form/tc_absolute_functions.rb +242 -240
  44. data/test/unit/form/ts_all.rb +4 -4
  45. data/test/unit/form/unix/tc_absolute_functions.rb +158 -155
  46. data/test/unit/form/unix/ts_all.rb +4 -4
  47. data/test/unit/form/windows/tc_absolute_functions.rb +628 -625
  48. data/test/unit/form/windows/ts_all.rb +4 -4
  49. data/test/unit/internal_/tc_array.rb +36 -32
  50. data/test/unit/internal_/ts_all.rb +4 -4
  51. data/test/unit/internal_/unix/form/tc_slash_functions.rb +38 -35
  52. data/test/unit/internal_/unix/form/ts_all.rb +4 -4
  53. data/test/unit/internal_/unix/tc_split_path.rb +387 -384
  54. data/test/unit/internal_/unix/ts_all.rb +4 -4
  55. data/test/unit/internal_/windows/form/tc_get_windows_volume.rb +157 -153
  56. data/test/unit/internal_/windows/form/tc_slash_functions.rb +39 -35
  57. data/test/unit/internal_/windows/form/ts_all.rb +4 -4
  58. data/test/unit/internal_/windows/tc_split_path.rb +874 -869
  59. data/test/unit/internal_/windows/ts_all.rb +4 -4
  60. data/test/unit/parse/ts_all.rb +4 -4
  61. data/test/unit/path/tc_path.rb +732 -732
  62. data/test/unit/path/ts_all.rb +4 -4
  63. data/test/unit/path/unix/tc_path.rb +544 -540
  64. data/test/unit/path/unix/ts_all.rb +4 -4
  65. data/test/unit/path/windows/tc_path.rb +608 -603
  66. data/test/unit/path/windows/ts_all.rb +4 -4
  67. data/test/unit/tc_version.rb +25 -22
  68. data/test/unit/ts_all.rb +4 -4
  69. data/test/unit/util/tc_combine_paths.rb +110 -105
  70. data/test/unit/util/tc_derive_relative_path.rb +8 -3
  71. data/test/unit/util/tc_make_path_canonical.rb +142 -138
  72. data/test/unit/util/ts_all.rb +4 -4
  73. data/test/unit/util/unix/tc_combine_paths.rb +38 -34
  74. data/test/unit/util/unix/tc_derive_relative_path.rb +80 -75
  75. data/test/unit/util/unix/tc_make_path_absolute.rb +74 -70
  76. data/test/unit/util/unix/tc_make_path_canonical.rb +95 -90
  77. data/test/unit/util/unix/ts_all.rb +4 -4
  78. data/test/unit/util/windows/tc_combine_paths.rb +82 -77
  79. data/test/unit/util/windows/tc_derive_relative_path.rb +98 -93
  80. data/test/unit/util/windows/tc_make_path_absolute.rb +105 -101
  81. data/test/unit/util/windows/tc_make_path_canonical.rb +158 -153
  82. data/test/unit/util/windows/ts_all.rb +4 -4
  83. metadata +9 -8
@@ -7,16 +7,16 @@ this_dir = File.expand_path(File.dirname(__FILE__))
7
7
  # all tc_*rb in current directory
8
8
  Dir[File.join(this_dir, 'tc_*rb')].each do |file|
9
9
 
10
- $stderr.puts "requiring file '#{file}'" if $DEBUG
10
+ $stderr.puts "requiring file '#{file}'" if $DEBUG
11
11
 
12
- require file
12
+ require file
13
13
  end
14
14
 
15
15
  # all ts_*rb in immediate sub-directories
16
16
  Dir[File.join(this_dir, '*', 'ts_*rb')].each do |file|
17
17
 
18
- $stderr.puts "requiring file '#{file}'" if $DEBUG
18
+ $stderr.puts "requiring file '#{file}'" if $DEBUG
19
19
 
20
- require file
20
+ require file
21
21
  end
22
22
 
@@ -2,219 +2,223 @@
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), *(['..'] * 5), 'lib')
4
4
 
5
+
5
6
  require 'libpath/internal_/windows/form'
6
7
 
7
8
  require 'test/unit'
8
9
 
10
+
9
11
  class Test_Internal_Windows_Form_get_windows_volume < Test::Unit::TestCase
10
12
 
11
- F = ::LibPath::Internal_::Windows::Form
13
+ F = ::LibPath::Internal_::Windows::Form
12
14
 
13
- def test_empty_string
15
+ def test_empty_string
14
16
 
15
- r = F.get_windows_volume('')
17
+ r = F.get_windows_volume('')
16
18
 
17
- assert_kind_of ::Array, r
18
- assert_equal 3, r.size
19
- assert_nil r[0]
20
- assert_equal '', r[1]
21
- assert_equal :form_0, r[2]
22
- end
19
+ assert_kind_of ::Array, r
20
+ assert_equal 3, r.size
21
+ assert_nil r[0]
22
+ assert_equal '', r[1]
23
+ assert_equal :form_0, r[2]
24
+ end
23
25
 
24
- def test_no_seps
26
+ def test_no_seps
25
27
 
26
- r = F.get_windows_volume('abc')
28
+ r = F.get_windows_volume('abc')
27
29
 
28
- assert_kind_of ::Array, r
29
- assert_equal 3, r.size
30
- assert_nil r[0]
31
- assert_equal 'abc', r[1]
32
- assert_equal :form_0, r[2]
33
- end
30
+ assert_kind_of ::Array, r
31
+ assert_equal 3, r.size
32
+ assert_nil r[0]
33
+ assert_equal 'abc', r[1]
34
+ assert_equal :form_0, r[2]
35
+ end
34
36
 
35
- def test_homed
37
+ def test_homed
36
38
 
37
- r = F.get_windows_volume('~')
39
+ r = F.get_windows_volume('~')
38
40
 
39
- assert_kind_of ::Array, r
40
- assert_equal 3, r.size
41
- assert_nil r[0]
42
- assert_equal '~', r[1]
43
- assert_equal :form_0, r[2]
44
- end
41
+ assert_kind_of ::Array, r
42
+ assert_equal 3, r.size
43
+ assert_nil r[0]
44
+ assert_equal '~', r[1]
45
+ assert_equal :form_0, r[2]
46
+ end
45
47
 
46
- def test_rooted
48
+ def test_rooted
47
49
 
48
- r = F.get_windows_volume('\\abc')
50
+ r = F.get_windows_volume('\\abc')
49
51
 
50
- assert_kind_of ::Array, r
51
- assert_equal 3, r.size
52
- assert_nil r[0]
53
- assert_equal '\\abc', r[1]
54
- assert_equal :form_0, r[2]
55
- end
52
+ assert_kind_of ::Array, r
53
+ assert_equal 3, r.size
54
+ assert_nil r[0]
55
+ assert_equal '\\abc', r[1]
56
+ assert_equal :form_0, r[2]
57
+ end
56
58
 
57
- def test_drive_standard
59
+ def test_drive_standard
58
60
 
59
- r = F.get_windows_volume('h:')
61
+ r = F.get_windows_volume('h:')
60
62
 
61
- assert_kind_of ::Array, r
62
- assert_equal 3, r.size
63
- assert_equal 'h:', r[0]
64
- assert_equal '', r[1]
65
- assert_equal :form_1, r[2]
63
+ assert_kind_of ::Array, r
64
+ assert_equal 3, r.size
65
+ assert_equal 'h:', r[0]
66
+ assert_equal '', r[1]
67
+ assert_equal :form_1, r[2]
66
68
 
67
- r = F.get_windows_volume('X:\\')
69
+ r = F.get_windows_volume('X:\\')
68
70
 
69
- assert_kind_of ::Array, r
70
- assert_equal 3, r.size
71
- assert_equal 'X:', r[0]
72
- assert_equal '\\', r[1]
73
- assert_equal :form_1, r[2]
71
+ assert_kind_of ::Array, r
72
+ assert_equal 3, r.size
73
+ assert_equal 'X:', r[0]
74
+ assert_equal '\\', r[1]
75
+ assert_equal :form_1, r[2]
74
76
 
75
- r = F.get_windows_volume('X:\\abc')
77
+ r = F.get_windows_volume('X:\\abc')
76
78
 
77
- assert_kind_of ::Array, r
78
- assert_equal 3, r.size
79
- assert_equal 'X:', r[0]
80
- assert_equal '\\abc', r[1]
81
- assert_equal :form_1, r[2]
79
+ assert_kind_of ::Array, r
80
+ assert_equal 3, r.size
81
+ assert_equal 'X:', r[0]
82
+ assert_equal '\\abc', r[1]
83
+ assert_equal :form_1, r[2]
82
84
 
83
- r = F.get_windows_volume('X:/abc')
85
+ r = F.get_windows_volume('X:/abc')
84
86
 
85
- assert_kind_of ::Array, r
86
- assert_equal 3, r.size
87
- assert_equal 'X:', r[0]
88
- assert_equal '/abc', r[1]
89
- assert_equal :form_1, r[2]
90
- end
87
+ assert_kind_of ::Array, r
88
+ assert_equal 3, r.size
89
+ assert_equal 'X:', r[0]
90
+ assert_equal '/abc', r[1]
91
+ assert_equal :form_1, r[2]
92
+ end
91
93
 
92
- def test_device
94
+ def test_device
93
95
 
94
- r = F.get_windows_volume('\\\\.\\the-device-name\\file')
96
+ r = F.get_windows_volume('\\\\.\\the-device-name\\file')
95
97
 
96
- assert_kind_of ::Array, r
97
- assert_equal 3, r.size
98
- assert_equal '\\\\.\\the-device-name', r[0]
99
- assert_equal '\\file', r[1]
100
- assert_equal :form_6, r[2]
98
+ assert_kind_of ::Array, r
99
+ assert_equal 3, r.size
100
+ assert_equal '\\\\.\\the-device-name', r[0]
101
+ assert_equal '\\file', r[1]
102
+ assert_equal :form_6, r[2]
101
103
 
102
- r = F.get_windows_volume('\\\\.\\the-device-name')
104
+ r = F.get_windows_volume('\\\\.\\the-device-name')
103
105
 
104
- assert_kind_of ::Array, r
105
- assert_equal 3, r.size
106
- assert_equal '\\\\.\\the-device-name', r[0]
107
- assert_equal '', r[1]
108
- assert_equal :form_6, r[2]
109
- end
106
+ assert_kind_of ::Array, r
107
+ assert_equal 3, r.size
108
+ assert_equal '\\\\.\\the-device-name', r[0]
109
+ assert_equal '', r[1]
110
+ assert_equal :form_6, r[2]
111
+ end
110
112
 
111
- def test_drive_long
113
+ def test_drive_long
112
114
 
113
- r = F.get_windows_volume('\\\\?\\h:')
115
+ r = F.get_windows_volume('\\\\?\\h:')
114
116
 
115
- assert_kind_of ::Array, r
116
- assert_equal 3, r.size
117
- assert_equal '\\\\?\\h:', r[0]
118
- assert_equal '', r[1]
119
- assert_equal :form_3, r[2]
117
+ assert_kind_of ::Array, r
118
+ assert_equal 3, r.size
119
+ assert_equal '\\\\?\\h:', r[0]
120
+ assert_equal '', r[1]
121
+ assert_equal :form_3, r[2]
120
122
 
121
- r = F.get_windows_volume('\\\\?\\X:\\')
123
+ r = F.get_windows_volume('\\\\?\\X:\\')
122
124
 
123
- assert_kind_of ::Array, r
124
- assert_equal 3, r.size
125
- assert_equal '\\\\?\\X:', r[0]
126
- assert_equal '\\', r[1]
127
- assert_equal :form_3, r[2]
125
+ assert_kind_of ::Array, r
126
+ assert_equal 3, r.size
127
+ assert_equal '\\\\?\\X:', r[0]
128
+ assert_equal '\\', r[1]
129
+ assert_equal :form_3, r[2]
128
130
 
129
- r = F.get_windows_volume('\\\\?\\X:\\abc')
131
+ r = F.get_windows_volume('\\\\?\\X:\\abc')
130
132
 
131
- assert_kind_of ::Array, r
132
- assert_equal 3, r.size
133
- assert_equal '\\\\?\\X:', r[0]
134
- assert_equal '\\abc', r[1]
135
- assert_equal :form_3, r[2]
133
+ assert_kind_of ::Array, r
134
+ assert_equal 3, r.size
135
+ assert_equal '\\\\?\\X:', r[0]
136
+ assert_equal '\\abc', r[1]
137
+ assert_equal :form_3, r[2]
136
138
 
137
- r = F.get_windows_volume('\\\\?\\X:/abc')
139
+ r = F.get_windows_volume('\\\\?\\X:/abc')
138
140
 
139
- assert_kind_of ::Array, r
140
- assert_equal 3, r.size
141
- assert_equal '\\\\?\\X:', r[0]
142
- assert_equal '/abc', r[1]
143
- assert_equal :form_3, r[2]
144
- end
141
+ assert_kind_of ::Array, r
142
+ assert_equal 3, r.size
143
+ assert_equal '\\\\?\\X:', r[0]
144
+ assert_equal '/abc', r[1]
145
+ assert_equal :form_3, r[2]
146
+ end
145
147
 
146
- def test_UNC_standard
148
+ def test_UNC_standard
147
149
 
148
- r = F.get_windows_volume('\\\\the-server-name\\the-share-name')
150
+ r = F.get_windows_volume('\\\\the-server-name\\the-share-name')
149
151
 
150
- assert_kind_of ::Array, r
151
- assert_equal 3, r.size
152
- assert_equal '\\\\the-server-name\\the-share-name', r[0]
153
- assert_equal '', r[1]
154
- assert_equal :form_2, r[2]
152
+ assert_kind_of ::Array, r
153
+ assert_equal 3, r.size
154
+ assert_equal '\\\\the-server-name\\the-share-name', r[0]
155
+ assert_equal '', r[1]
156
+ assert_equal :form_2, r[2]
155
157
 
156
- r = F.get_windows_volume('\\\\the-server-name\\the-share-name\\')
158
+ r = F.get_windows_volume('\\\\the-server-name\\the-share-name\\')
157
159
 
158
- assert_kind_of ::Array, r
159
- assert_equal 3, r.size
160
- assert_equal '\\\\the-server-name\\the-share-name', r[0]
161
- assert_equal '\\', r[1]
162
- assert_equal :form_2, r[2]
160
+ assert_kind_of ::Array, r
161
+ assert_equal 3, r.size
162
+ assert_equal '\\\\the-server-name\\the-share-name', r[0]
163
+ assert_equal '\\', r[1]
164
+ assert_equal :form_2, r[2]
163
165
 
164
- r = F.get_windows_volume('\\\\the-server-name\\the-share-name\\file.ext')
166
+ r = F.get_windows_volume('\\\\the-server-name\\the-share-name\\file.ext')
165
167
 
166
- assert_kind_of ::Array, r
167
- assert_equal 3, r.size
168
- assert_equal '\\\\the-server-name\\the-share-name', r[0]
169
- assert_equal '\\file.ext', r[1]
170
- assert_equal :form_2, r[2]
171
- end
168
+ assert_kind_of ::Array, r
169
+ assert_equal 3, r.size
170
+ assert_equal '\\\\the-server-name\\the-share-name', r[0]
171
+ assert_equal '\\file.ext', r[1]
172
+ assert_equal :form_2, r[2]
173
+ end
172
174
 
173
- def test_UNC_long
175
+ def test_UNC_long
174
176
 
175
- r = F.get_windows_volume('\\\\?\\the-server-name\\the-share-name')
177
+ r = F.get_windows_volume('\\\\?\\the-server-name\\the-share-name')
176
178
 
177
- assert_kind_of ::Array, r
178
- assert_equal 3, r.size
179
- assert_equal '\\\\?\\the-server-name\\the-share-name', r[0]
180
- assert_equal '', r[1]
181
- assert_equal :form_4, r[2]
179
+ assert_kind_of ::Array, r
180
+ assert_equal 3, r.size
181
+ assert_equal '\\\\?\\the-server-name\\the-share-name', r[0]
182
+ assert_equal '', r[1]
183
+ assert_equal :form_4, r[2]
182
184
 
183
- r = F.get_windows_volume('\\\\?\\the-server-name\\the-share-name\\')
185
+ r = F.get_windows_volume('\\\\?\\the-server-name\\the-share-name\\')
184
186
 
185
- assert_kind_of ::Array, r
186
- assert_equal 3, r.size
187
- assert_equal '\\\\?\\the-server-name\\the-share-name', r[0]
188
- assert_equal '\\', r[1]
189
- assert_equal :form_4, r[2]
187
+ assert_kind_of ::Array, r
188
+ assert_equal 3, r.size
189
+ assert_equal '\\\\?\\the-server-name\\the-share-name', r[0]
190
+ assert_equal '\\', r[1]
191
+ assert_equal :form_4, r[2]
190
192
 
191
- r = F.get_windows_volume('\\\\?\\the-server-name\\the-share-name\\file.ext')
193
+ r = F.get_windows_volume('\\\\?\\the-server-name\\the-share-name\\file.ext')
192
194
 
193
- assert_kind_of ::Array, r
194
- assert_equal 3, r.size
195
- assert_equal '\\\\?\\the-server-name\\the-share-name', r[0]
196
- assert_equal '\\file.ext', r[1]
197
- assert_equal :form_4, r[2]
198
- end
195
+ assert_kind_of ::Array, r
196
+ assert_equal 3, r.size
197
+ assert_equal '\\\\?\\the-server-name\\the-share-name', r[0]
198
+ assert_equal '\\file.ext', r[1]
199
+ assert_equal :form_4, r[2]
200
+ end
199
201
 
200
- def test_UNC_full
202
+ def test_UNC_full
201
203
 
202
- r = F.get_windows_volume('\\\\?\\UNC\\the-server-name\\the-share-name')
204
+ r = F.get_windows_volume('\\\\?\\UNC\\the-server-name\\the-share-name')
203
205
 
204
- assert_kind_of ::Array, r
205
- assert_equal 3, r.size
206
- assert_equal '\\\\?\\UNC\\the-server-name\\the-share-name', r[0]
207
- assert_equal '', r[1]
208
- assert_equal :form_5, r[2]
206
+ assert_kind_of ::Array, r
207
+ assert_equal 3, r.size
208
+ assert_equal '\\\\?\\UNC\\the-server-name\\the-share-name', r[0]
209
+ assert_equal '', r[1]
210
+ assert_equal :form_5, r[2]
209
211
 
210
- r = F.get_windows_volume('\\\\?\\UNC\\the-server-name\\the-share-name\\')
212
+ r = F.get_windows_volume('\\\\?\\UNC\\the-server-name\\the-share-name\\')
211
213
 
212
- assert_kind_of ::Array, r
213
- assert_equal 3, r.size
214
- assert_equal '\\\\?\\UNC\\the-server-name\\the-share-name', r[0]
215
- assert_equal '\\', r[1]
216
- assert_equal :form_5, r[2]
217
- end
214
+ assert_kind_of ::Array, r
215
+ assert_equal 3, r.size
216
+ assert_equal '\\\\?\\UNC\\the-server-name\\the-share-name', r[0]
217
+ assert_equal '\\', r[1]
218
+ assert_equal :form_5, r[2]
219
+ end
218
220
  end
219
221
 
220
222
 
223
+ # ############################## end of file ############################# #
224
+
@@ -2,60 +2,64 @@
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), *(['..'] * 5), 'lib')
4
4
 
5
+
5
6
  require 'libpath/internal_/windows/form'
6
7
 
7
8
  require 'test/unit'
8
9
 
9
10
  require 'xqsr3/extensions/test/unit'
10
11
 
12
+
11
13
  class Test_Internal_Windows_Form_slash_functions < Test::Unit::TestCase
12
14
 
13
- F = ::LibPath::Internal_::Windows::Form
15
+ F = ::LibPath::Internal_::Windows::Form
14
16
 
15
- def test_char_is_path_name_separator?
17
+ def test_char_is_path_name_separator?
16
18
 
17
- assert_false F.char_is_path_name_separator?('')
18
- assert_false F.char_is_path_name_separator?('a')
19
+ assert_false F.char_is_path_name_separator?('')
20
+ assert_false F.char_is_path_name_separator?('a')
19
21
 
20
- assert F.char_is_path_name_separator?('/')
21
- assert F.char_is_path_name_separator?('\\')
22
- end
22
+ assert F.char_is_path_name_separator?('/')
23
+ assert F.char_is_path_name_separator?('\\')
24
+ end
23
25
 
24
- def test_append_trailing_slash
26
+ def test_append_trailing_slash
25
27
 
26
- assert_equal '\\', F.append_trailing_slash('')
27
- assert_equal '/', F.append_trailing_slash('/')
28
- assert_equal 'a\\', F.append_trailing_slash('a')
29
- assert_equal 'a/', F.append_trailing_slash('a/')
30
- end
28
+ assert_equal '\\', F.append_trailing_slash('')
29
+ assert_equal '/', F.append_trailing_slash('/')
30
+ assert_equal 'a\\', F.append_trailing_slash('a')
31
+ assert_equal 'a/', F.append_trailing_slash('a/')
32
+ end
31
33
 
32
- def test_get_trailing_slash
34
+ def test_get_trailing_slash
33
35
 
34
- assert_nil F.get_trailing_slash('')
35
- assert_equal '/', F.get_trailing_slash('/')
36
- assert_nil F.get_trailing_slash('a')
37
- assert_equal '\\', F.get_trailing_slash('\\')
38
- assert_equal '/', F.get_trailing_slash('a/')
39
- end
36
+ assert_nil F.get_trailing_slash('')
37
+ assert_equal '/', F.get_trailing_slash('/')
38
+ assert_nil F.get_trailing_slash('a')
39
+ assert_equal '\\', F.get_trailing_slash('\\')
40
+ assert_equal '/', F.get_trailing_slash('a/')
41
+ end
40
42
 
41
- def test_has_trailing_slash
43
+ def test_has_trailing_slash
42
44
 
43
- assert_false F.has_trailing_slash?('')
44
- assert_true F.has_trailing_slash?('/')
45
- assert_false F.has_trailing_slash?('a')
46
- assert_true F.has_trailing_slash?('\\')
47
- assert_true F.has_trailing_slash?('a/')
48
- end
45
+ assert_false F.has_trailing_slash?('')
46
+ assert_true F.has_trailing_slash?('/')
47
+ assert_false F.has_trailing_slash?('a')
48
+ assert_true F.has_trailing_slash?('\\')
49
+ assert_true F.has_trailing_slash?('a/')
50
+ end
49
51
 
50
- def test_trim_trailing_slash
52
+ def test_trim_trailing_slash
51
53
 
52
- assert_equal '', F.trim_trailing_slash('')
53
- assert_equal '', F.trim_trailing_slash('/')
54
- assert_equal 'a', F.trim_trailing_slash('a')
55
- assert_equal '', F.trim_trailing_slash('\\')
56
- assert_equal 'a', F.trim_trailing_slash('a/')
57
- assert_equal 'a', F.trim_trailing_slash('a\\')
58
- end
54
+ assert_equal '', F.trim_trailing_slash('')
55
+ assert_equal '', F.trim_trailing_slash('/')
56
+ assert_equal 'a', F.trim_trailing_slash('a')
57
+ assert_equal '', F.trim_trailing_slash('\\')
58
+ assert_equal 'a', F.trim_trailing_slash('a/')
59
+ assert_equal 'a', F.trim_trailing_slash('a\\')
60
+ end
59
61
  end
60
62
 
61
63
 
64
+ # ############################## end of file ############################# #
65
+
@@ -7,16 +7,16 @@ this_dir = File.expand_path(File.dirname(__FILE__))
7
7
  # all tc_*rb in current directory
8
8
  Dir[File.join(this_dir, 'tc_*rb')].each do |file|
9
9
 
10
- $stderr.puts "requiring file '#{file}'" if $DEBUG
10
+ $stderr.puts "requiring file '#{file}'" if $DEBUG
11
11
 
12
- require file
12
+ require file
13
13
  end
14
14
 
15
15
  # all ts_*rb in immediate sub-directories
16
16
  Dir[File.join(this_dir, '*', 'ts_*rb')].each do |file|
17
17
 
18
- $stderr.puts "requiring file '#{file}'" if $DEBUG
18
+ $stderr.puts "requiring file '#{file}'" if $DEBUG
19
19
 
20
- require file
20
+ require file
21
21
  end
22
22