|
186 | 186 | Dir.glob('**/**', base: "dir").should == ["filename_ordering"]
|
187 | 187 |
|
188 | 188 | expected = %w[
|
189 |
| - directory |
190 |
| - directory/structure |
191 |
| - directory/structure/bar |
192 |
| - directory/structure/baz |
193 |
| - directory/structure/file_one |
194 |
| - directory/structure/file_one.ext |
195 |
| - directory/structure/foo |
| 189 | + nested |
| 190 | + nested/directory |
| 191 | + nested/directory/structure |
| 192 | + nested/directory/structure/bar |
| 193 | + nested/directory/structure/baz |
| 194 | + nested/directory/structure/file_one |
| 195 | + nested/directory/structure/file_one.ext |
| 196 | + nested/directory/structure/foo |
| 197 | + nondotfile |
196 | 198 | ].sort
|
197 | 199 |
|
198 |
| - Dir.glob('**/**', base: "deeply/nested").sort.should == expected |
| 200 | + Dir.glob('**/**', base: "deeply").sort.should == expected |
199 | 201 | end
|
200 | 202 |
|
201 | 203 | it "handles **/ with base keyword argument" do
|
|
207 | 209 | Dir.glob('**/', base: "deeply/nested").sort.should == expected
|
208 | 210 | end
|
209 | 211 |
|
210 |
| - # 2.7 and 3.0 include a "." entry for every dir: ["directory/.", "directory/structure/.", ...] |
211 |
| - guard_not -> { ruby_version_is ''...'3.1' } do |
212 |
| - it "handles **/.* with base keyword argument" do |
213 |
| - expected = %w[ |
214 |
| - .dotfile.ext |
215 |
| - directory/structure/.ext |
216 |
| - ].sort |
| 212 | + it "handles **/nondotfile with base keyword argument" do |
| 213 | + expected = %w[ |
| 214 | + deeply/nondotfile |
| 215 | + nondotfile |
| 216 | + subdir_one/nondotfile |
| 217 | + subdir_two/nondotfile |
| 218 | + ] |
| 219 | + Dir.glob('**/nondotfile', base: ".").sort.should == expected |
| 220 | + end |
217 | 221 |
|
218 |
| - Dir.glob('**/.*', base: "deeply/nested").sort.should == expected |
219 |
| - end |
| 222 | + it "handles **/nondotfile with base keyword argument and FNM_DOTMATCH" do |
| 223 | + expected = %w[ |
| 224 | + .dotsubdir/nondotfile |
| 225 | + deeply/nondotfile |
| 226 | + nested/.dotsubir/nondotfile |
| 227 | + nondotfile |
| 228 | + subdir_one/nondotfile |
| 229 | + subdir_two/nondotfile |
| 230 | + ] |
| 231 | + Dir.glob('**/nondotfile', File::FNM_DOTMATCH, base: ".").sort.should == expected |
| 232 | + end |
220 | 233 |
|
| 234 | + it "handles **/.dotfile with base keyword argument" do |
| 235 | + expected = %w[ |
| 236 | + .dotfile |
| 237 | + deeply/.dotfile |
| 238 | + subdir_one/.dotfile |
| 239 | + ] |
| 240 | + Dir.glob('**/.dotfile', base: ".").sort.should == expected |
| 241 | + end |
| 242 | + |
| 243 | + it "handles **/.dotfile with base keyword argument and FNM_DOTMATCH" do |
| 244 | + expected = %w[ |
| 245 | + .dotfile |
| 246 | + .dotsubdir/.dotfile |
| 247 | + deeply/.dotfile |
| 248 | + nested/.dotsubir/.dotfile |
| 249 | + subdir_one/.dotfile |
| 250 | + ] |
| 251 | + Dir.glob('**/.dotfile', File::FNM_DOTMATCH, base: ".").sort.should == expected |
| 252 | + end |
| 253 | + |
| 254 | + it "handles **/.* with base keyword argument" do |
| 255 | + expected = %w[ |
| 256 | + .dotfile.ext |
| 257 | + directory/structure/.ext |
| 258 | + ].sort |
| 259 | + |
| 260 | + Dir.glob('**/.*', base: "deeply/nested").sort.should == expected |
| 261 | + end |
| 262 | + |
| 263 | + # 2.7 and 3.0 include a "." entry for every dir: ["directory/.", "directory/structure/.", ...] |
| 264 | + ruby_version_is '3.1' do |
221 | 265 | it "handles **/.* with base keyword argument and FNM_DOTMATCH" do
|
222 | 266 | expected = %w[
|
223 | 267 | .
|
|
0 commit comments