recls-ruby 2.12.0.1 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7ad41cfec6d08d5ba41ef9c6bc47f5b151d61a232f9f7a04ce389ca49487f51
4
- data.tar.gz: 9cb9cff1104388001437470dbd6cb82566313f78d82b0a5b323689573f57f5d9
3
+ metadata.gz: 6d6532f17abe260ced9482626db483f1f41d27e9bb152bbd870b5b525bba4399
4
+ data.tar.gz: eb78ee7591a8014fa293b236ef5e7ae8a35ecd3559105ea07eab6fe132e37955
5
5
  SHA512:
6
- metadata.gz: 5c61cd03d38a8d459d9bbfc3f150e0fed22182abef92da86dd135040690088f070d69f55cfa3ccf4312f7d1b122d921eb72b48e2137fa8801e1360d29aec4dfe
7
- data.tar.gz: fb1603cbf0f8ffd86c1c679ac08f0d5bf5c770d8d4348a24b74bab1e5440b28f6f35a7e8ef4368252eaf9ab0d5f081935814ebd48ade0c26939340a964b748e0
6
+ metadata.gz: 730ea68a021a6657485d618aaf10cc42284a138330c4e5b8e2c48ebafef46f1955b26ada22a9008aa6b9f3bacb6271354f6dd07fe179177165892299f5a35fde
7
+ data.tar.gz: 0d57bec94aaa38ec8cd3d1577570e571e00fd3fd503d621ba4cd65325e49ff7f215977cb7b12a3d6260aef00523fd37bef248c5a7cb92b83532b16d89640ccb7
@@ -19,7 +19,7 @@ require 'recls'
19
19
  # 2. Filter returned entries by hidden? attribute
20
20
  Recls.file_rsearch('.', Recls::WILDCARDS_ALL, Recls::FILES | Recls::SHOW_HIDDEN).each do |fe|
21
21
 
22
- puts fe.path if fe.hidden?
22
+ puts fe if fe.hidden?
23
23
  end
24
24
  ```
25
25
 
@@ -10,6 +10,6 @@ require 'recls'
10
10
  # 2. Filter returned entries by hidden? attribute
11
11
  Recls.file_rsearch('.', Recls::WILDCARDS_ALL, Recls::FILES | Recls::SHOW_HIDDEN).each do |fe|
12
12
 
13
- puts fe.path if fe.hidden?
13
+ puts fe if fe.hidden?
14
14
  end
15
15
 
@@ -18,7 +18,7 @@ require 'recls'
18
18
  # 1. Filter returned entries by readonly? attribute
19
19
  Recls.file_rsearch('.', Recls::WILDCARDS_ALL, Recls::FILES).each do |fe|
20
20
 
21
- puts fe.path if fe.readonly?
21
+ puts fe if fe.readonly?
22
22
  end
23
23
  ```
24
24
 
@@ -9,6 +9,6 @@ require 'recls'
9
9
  # 1. Filter returned entries by readonly? attribute
10
10
  Recls.file_rsearch('.', Recls::WILDCARDS_ALL, Recls::FILES).each do |fe|
11
11
 
12
- puts fe.path if fe.readonly?
12
+ puts fe if fe.readonly?
13
13
  end
14
14
 
data/lib/recls/api.rb CHANGED
@@ -66,7 +66,7 @@ module Recls
66
66
  # - +options+ (+Hash+, +Integer+) Combination of flags (with behaviour as described below for the +flags+ option), or an options hash;
67
67
  #
68
68
  # * *Options:*
69
- # - +flags+ (+Integer+) Combination of flags - +Recls::FILES+, +Recls::DIRECTORIES+, etc. If the value modulo +Recls::TYPEMASK+ is 0, then +Recls::FILES+ is assumed. The value +Recls::RECURSIVE+ is added by the function, and so need not be added by the caller; it cannot be removed
69
+ # - +flags+ (+Integer+) Combination of flags - +Recls::FILES+, +Recls::DIRECTORIES+, etc. If the value modulo +Recls::TYPEMASK+ is 0, then +Recls::FILES+ is assumed. The value +Recls::RECURSIVE+ is added by the function, and so need not be added by the caller; it cannot be removed;
70
70
  #
71
71
  # === Return
72
72
  # An instance of a class implementing +Enumerable+ whose value type is
@@ -105,7 +105,7 @@ module Recls
105
105
  # - +options+ (+Hash+, +Integer+) Combination of flags (with behaviour as described below for the +flags+ option), or an options hash;
106
106
  #
107
107
  # * *Options:*
108
- # - +flags+ (+Integer+) Combination of flags - +Recls::FILES+, +Recls::DIRECTORIES+, +Recls::RECURSIVE+, etc. If the value modulo +Recls::TYPEMASK+ is 0, then +Recls::FILES+ is assumed
108
+ # - +flags+ (+Integer+) Combination of flags - +Recls::FILES+, +Recls::DIRECTORIES+, +Recls::RECURSIVE+, etc. If the value modulo +Recls::TYPEMASK+ is 0, then +Recls::FILES+ is assumed;
109
109
  #
110
110
  # === Return
111
111
  # An instance of a class implementing +Enumerable+ whose value type is
@@ -53,17 +53,18 @@ module Recls
53
53
  # === Signature
54
54
  #
55
55
  # * *Parameters:*
56
- # - +paths+ (+[ String, Recls::Entry ]+) Array of 1 or more path elements to be combined;
56
+ # - +paths+ (+[ (String, Recls::Entry) ]+) Array of 1 or more path elements to be combined;
57
57
  #
58
58
  # === Return
59
59
  # (+String+) The combined path.
60
60
  def self.combine_paths(*paths)
61
61
 
62
- paths = paths.reject { |p| p.nil? }
63
- paths = paths.map { |p| 'Recls::Entry' == p.class.to_s ? p.path : p }
62
+ paths.reject! { |p| p.nil? }
64
63
 
65
64
  raise ArgumentError, 'must specify one or more path elements' if paths.empty?
66
65
 
66
+ ix_last_entry = paths.rindex { |path| ::Recls::Entry === path } and return paths[ix_last_entry]
67
+
67
68
  return Recls::Ximpl.combine_paths paths, {}
68
69
  end
69
70
  end # module Recls
@@ -53,7 +53,7 @@ module Recls
53
53
  # === Signature
54
54
  #
55
55
  # * *Parameters:*
56
- # - +paths+ (+[ String, Recls::Entry ]+) Array of 1 or more path elements to be combined;
56
+ # - +paths+ (+[ (String, Recls::Entry) ]+) Array of 1 or more path elements to be combined;
57
57
  # - +options+ (+Hash+) Options that moderate the combination;
58
58
  #
59
59
  # * *Options:*
@@ -65,11 +65,12 @@ module Recls
65
65
  # (+String+) The combined path.
66
66
  def self.combine_paths(*paths, **options)
67
67
 
68
- paths = paths.reject { |p| p.nil? }
69
- paths = paths.map { |p| 'Recls::Entry' == p.class.to_s ? p.path : p }
68
+ paths.reject! { |p| p.nil? }
70
69
 
71
70
  raise ArgumentError, 'must specify one or more path elements' if paths.empty?
72
71
 
72
+ ix_last_entry = paths.rindex { |path| ::Recls::Entry === path } and return paths[ix_last_entry]
73
+
73
74
  return Recls::Ximpl.combine_paths paths, options
74
75
  end
75
76
  end # module Recls
data/lib/recls/entry.rb CHANGED
@@ -398,5 +398,35 @@ module Recls
398
398
  end # module Recls
399
399
 
400
400
 
401
+ # We now monkey-patch `::String` cautiously, to facilitate constructs such
402
+ # as:
403
+ #
404
+ # cwd = Recls.stat @cwd
405
+ # assert_equal @cwd, cwd
406
+
407
+
408
+ =begin
409
+ =end
410
+
411
+ # @!visibility private
412
+ class String # :nodoc:
413
+
414
+ # TODO: work out if can use `super` for all supported versions of Ruby
415
+
416
+ # @!visibility private
417
+ alias_method :String_modified_for_Recls_Entry_for_original_op_eq, :== # :nodoc:
418
+
419
+ def == rhs
420
+
421
+ if ::Recls::Entry === rhs
422
+
423
+ rhs = rhs.path
424
+ end
425
+
426
+ String_modified_for_Recls_Entry_for_original_op_eq rhs
427
+ end
428
+ end
429
+
430
+
401
431
  # ############################## end of file ############################# #
402
432
 
@@ -89,7 +89,7 @@ module Recls
89
89
  flags = options[:flags] || 0
90
90
  else
91
91
 
92
- raise ArgumentError, "options parameter must a #{::Hash}, nil, or an integer specifying flags - an instance of #{options.class} given"
92
+ raise ArgumentError, "options parameter must a `#{::Hash}`, `nil`, or an integer specifying flags - an instance of `#{options.class}` given"
93
93
  end
94
94
 
95
95
 
data/lib/recls/recls.rb CHANGED
@@ -37,16 +37,6 @@
37
37
  # ######################################################################## #
38
38
 
39
39
 
40
- require 'recls/version'
41
-
42
- require 'recls/api'
43
- require 'recls/entry'
44
- require 'recls/file_search'
45
- require 'recls/foreach'
46
- require 'recls/stat'
47
- require 'recls/util'
48
- require 'recls/ximpl/os'
49
-
50
40
  # The *recls* module
51
41
  #
52
42
  # == Significant Components
@@ -62,6 +52,21 @@ require 'recls/ximpl/os'
62
52
  # - Recls::file_search
63
53
  # - Recls::foreach
64
54
  # - Recls::stat
55
+ module Recls
56
+ end # module Recls
57
+
58
+
59
+ require 'recls/version'
60
+
61
+ require 'recls/api'
62
+ require 'recls/entry'
63
+ require 'recls/file_search'
64
+ require 'recls/foreach'
65
+ require 'recls/stat'
66
+ require 'recls/util'
67
+ require 'recls/ximpl/os'
68
+
69
+
65
70
  module Recls
66
71
 
67
72
  # The string sequence used to separate names in paths, e.g. "/" on UNIX
@@ -80,6 +85,7 @@ module Recls
80
85
  end
81
86
  end # module Recls
82
87
 
88
+
83
89
  require 'recls/obsolete'
84
90
 
85
91
 
data/lib/recls/stat.rb CHANGED
@@ -109,7 +109,7 @@ module Recls
109
109
  #
110
110
  # * *Parameters:*
111
111
  # - +path+ (+String+) A path to evaluate. May not be +nil+;
112
- # - +search_root+ (+String+, +Recls::Entry+) A directory from which the returned Entry instance's search-relative attributes are evaluated;
112
+ # - +search_root+ (+String+, +Recls::Entry+) A directory from which the returned +Entry+ instance's search-relative attributes are evaluated;
113
113
  # - +flags+ (+Integer+) A bit-combined set of flags (such as +Recls::DIRECTORIES+, +Recls::FILES+, +Recls::RECURSIVE+, +Recls::DETAILS_LATER+, and so on);
114
114
  #
115
115
  # ==== Parameter Ordering
@@ -132,12 +132,17 @@ module Recls
132
132
  search_root = nil
133
133
  message = nil
134
134
 
135
- path = File.expand_path(path) if path =~ /^~[\\\/]*/
135
+ path_is_entry = ::Recls::Entry === path
136
+
137
+ unless path_is_entry
138
+
139
+ path = File.expand_path(path) if path =~ /^~[\\\/]*/
140
+ end
136
141
 
137
142
  case args.size
138
143
  when 0
139
144
 
140
- ;
145
+ return path if path_is_entry
141
146
  when 1
142
147
 
143
148
  case args[0]
@@ -149,7 +154,7 @@ module Recls
149
154
  search_root = args[0]
150
155
  else
151
156
 
152
- message = "argument '#{args[0]}' (#{args[0].class}) not valid"
157
+ message = "argument '#{args[0]}' (of type `#{args[0].class}`) not valid"
153
158
  end
154
159
  when 2
155
160
 
@@ -171,7 +176,7 @@ module Recls
171
176
  message = "too many arguments"
172
177
  end
173
178
 
174
- raise ArgumentError, "#{message}: Recls.stat() takes one (path), two (path+flags or path+search_root), or three (path+search_root+flags) arguments" if message
179
+ raise ArgumentError, "#{message}: `Recls.stat()` takes one (path), two (path+flags or path+search_root), or three (path+search_root+flags) arguments" if message
175
180
 
176
181
  Recls::Ximpl.stat_prep(path, search_root, flags)
177
182
  end
data/lib/recls/util.rb CHANGED
@@ -61,8 +61,6 @@ module Recls
61
61
  # (+String+) The absolute form of the path.
62
62
  def self.absolute_path(path)
63
63
 
64
- return path.path if 'Recls::Entry' === path.class.to_s
65
-
66
64
  Recls::Ximpl.absolute_path path
67
65
  end
68
66
 
@@ -78,7 +76,7 @@ module Recls
78
76
  # (+String+) The canonical form of the path.
79
77
  def self.canonicalise_path(path)
80
78
 
81
- path = path.path if 'Recls::Entry' === path.class.to_s
79
+ return path.path if ::Recls::Entry === path
82
80
 
83
81
  Recls::Ximpl.canonicalise_path path
84
82
  end
@@ -132,16 +130,12 @@ module Recls
132
130
  # === Signature
133
131
  #
134
132
  # * *Parameters:*
135
- # - +path+ (+String+, +Recls::Entry+) The path;
133
+ # - +path+ (+String+, +Recls::Entry+, +nil+) The path to be evaluated;
136
134
  #
137
135
  # === Return
138
136
  # (boolean) +true+ if +path+ is absolute; +false+ otherwise.
139
137
  def self.absolute_path?(path)
140
138
 
141
- return nil if path.nil?
142
-
143
- return true if 'Recls::Entry' === path.class.to_s
144
-
145
139
  Recls::Ximpl.absolute_path? path
146
140
  end
147
141
  end # module Recls
data/lib/recls/version.rb CHANGED
@@ -46,7 +46,7 @@ class Object; end # :nodoc:
46
46
  module Recls
47
47
 
48
48
  # Current version of the recls.Ruby library
49
- VERSION = '2.12.0.1'
49
+ VERSION = '2.13.0'
50
50
 
51
51
  private
52
52
  # @!visibility private
@@ -454,6 +454,8 @@ module Recls # :nodoc:
454
454
  # @!visibility private
455
455
  def self.canonicalise_path(path) # :nodoc:
456
456
 
457
+ raise ArgumentError, "`path` must be an instance of `::String` or `nil`" if $DEBUG && !path.nil? && !path.is_a?(::String)
458
+
457
459
  return nil if not path
458
460
  return '' if path.empty?
459
461
 
@@ -495,7 +497,7 @@ module Recls # :nodoc:
495
497
  return path
496
498
  else
497
499
 
498
- raise TypeError, "parameter path ('#{path}') is of type #{path.class} must be nil or an instance of #{::String} or #{::Recls::Entry}"
500
+ raise TypeError, "parameter path ('#{path}') is of type `#{path.class}` must be `nil` or an instance of `#{::String}` or `#{::Recls::Entry}`"
499
501
  end
500
502
 
501
503
  f1_windows_root, f2_directory, dummy1, dummy2, dummy3, dummy4, dummy5 = Util.split_path(path)
@@ -529,7 +531,7 @@ module Recls # :nodoc:
529
531
  return path.path
530
532
  else
531
533
 
532
- raise TypeError, "parameter path ('#{path}') is of type #{path.class} must be an instance of #{::String} or Recls::Entry"
534
+ raise TypeError, "parameter path ('#{path}') is of type `#{path.class}` must be an instance of `#{::String}` or `#{::Recls::Entry}`"
533
535
  end
534
536
 
535
537
  return '' if path.empty?
@@ -776,7 +778,9 @@ module Recls # :nodoc:
776
778
  # @!visibility private
777
779
  def self.combine_paths(paths, options) # :nodoc:
778
780
 
779
- paths = [ paths ] unless ::Array === paths
781
+ raise ArgumentError, "`paths` must be an instance of `::Array`" if $DEBUG && !paths.is_a?(::Array)
782
+ raise ArgumentError, "`paths` elements must be instances of `::String`" if $DEBUG && paths.any? { |s| !s.is_a?(::String) }
783
+
780
784
  abs_ix = 0
781
785
 
782
786
  paths = paths.map { |path| '~' == path[0].to_s ? File.expand_path(path) : path }
@@ -840,7 +844,7 @@ module Recls # :nodoc:
840
844
 
841
845
  rescue SystemCallError => x
842
846
 
843
- $stderr.puts "exception (#{x.class}): #{x}" if $DEBUG
847
+ $stderr.puts "exception (`#{x.class}`): #{x}" if $DEBUG
844
848
 
845
849
  if(0 != (STOP_ON_ACCESS_FAILURE & flags))
846
850
 
@@ -27,14 +27,29 @@ class Test_Recls_entry < Test::Unit::TestCase
27
27
  cwd = Recls.stat @cwd
28
28
 
29
29
  assert_equal @cwd, cwd.path
30
+ assert_equal @cwd, cwd
31
+
32
+ cwd2 = Recls.stat cwd
33
+
34
+ assert_equal @cwd, cwd.path
35
+ assert_equal @cwd, cwd
36
+
37
+ assert_equal cwd.object_id, cwd2.object_id
30
38
  end
31
39
 
32
40
  def test_entry_does_mark_directory
33
41
 
34
42
  cwd = Recls.stat @cwd, Recls::MARK_DIRECTORIES
35
43
 
36
- # assert_equal "#{@cwd}#{Recls::PATH_NAME_SEPARATOR}", cwd.path
37
44
  assert_equal "#{@cwd}/", cwd.path
45
+ assert_equal "#{@cwd}/", cwd
46
+
47
+ cwd2 = Recls.stat cwd, Recls::MARK_DIRECTORIES
48
+
49
+ assert_equal "#{@cwd}/", cwd.path
50
+ assert_equal "#{@cwd}/", cwd
51
+
52
+ assert_not_equal cwd.object_id, cwd2.object_id
38
53
  end
39
54
  end
40
55
 
@@ -6,6 +6,10 @@ $:.unshift File.join(File.dirname(__FILE__), '../..', 'lib')
6
6
 
7
7
  require 'recls/util'
8
8
 
9
+ if RUBY_VERSION >= '2'
10
+
11
+ require 'xqsr3/extensions/test/unit'
12
+ end
9
13
  require 'test/unit'
10
14
 
11
15
 
@@ -13,7 +17,13 @@ class Test_combine_paths < Test::Unit::TestCase
13
17
 
14
18
  def test_nil_nil
15
19
 
16
- assert_raise(::ArgumentError) { Recls.combine_paths(nil, nil) }
20
+ if RUBY_VERSION >= '2'
21
+
22
+ assert_raise_with_message(::ArgumentError, /must specify one or more path elements/) { Recls.combine_paths(nil, nil) }
23
+ else
24
+
25
+ assert_raise(::ArgumentError) { Recls.combine_paths(nil, nil) }
26
+ end
17
27
  end
18
28
 
19
29
  def test_origin_nil
@@ -56,26 +66,29 @@ class Test_combine_paths < Test::Unit::TestCase
56
66
  assert_equal 'abc/def/ghi', Recls.combine_paths('abc/', 'def/ghi')
57
67
  assert_equal 'abc/./def/ghi', Recls.combine_paths('abc/.', 'def/ghi')
58
68
  assert_equal 'abc/./def/ghi', Recls.combine_paths('abc/./', 'def/ghi')
69
+
59
70
  if RUBY_VERSION >= '2'
60
- assert_equal 'abc/./def/ghi', Recls.combine_paths('abc/.', 'def/ghi', clean_path: false)
61
- assert_equal 'abc/./def/ghi', Recls.combine_paths('abc/./', 'def/ghi', clean: false)
62
- assert_equal 'abc/def/ghi', Recls.combine_paths('abc/.', 'def/ghi', clean_path: true)
63
- assert_equal 'abc/def/ghi', Recls.combine_paths('abc/./', 'def/ghi', clean: true)
64
- assert_equal 'abc/def/ghi', Recls.combine_paths('abc/./.', 'def/ghi', clean_path: true)
65
- assert_equal 'abc/../def/ghi', Recls.combine_paths('abc/..', 'def/ghi')
66
- assert_equal 'def/ghi', Recls.combine_paths('abc/..', 'def/ghi', clean_path: true)
71
+
72
+ assert_equal 'abc/./def/ghi', Recls.combine_paths('abc/.', 'def/ghi', clean_path: false)
73
+ assert_equal 'abc/./def/ghi', Recls.combine_paths('abc/./', 'def/ghi', clean: false)
74
+ assert_equal 'abc/def/ghi', Recls.combine_paths('abc/.', 'def/ghi', clean_path: true)
75
+ assert_equal 'abc/def/ghi', Recls.combine_paths('abc/./', 'def/ghi', clean: true)
76
+ assert_equal 'abc/def/ghi', Recls.combine_paths('abc/./.', 'def/ghi', clean_path: true)
77
+ assert_equal 'abc/../def/ghi', Recls.combine_paths('abc/..', 'def/ghi')
78
+ assert_equal 'def/ghi', Recls.combine_paths('abc/..', 'def/ghi', clean_path: true)
67
79
  end
68
80
  end
69
81
 
70
82
  def test_multiple_relative
71
83
 
72
84
  if RUBY_VERSION >= '2'
73
- assert_equal 'a/b/c/d/e/f/g', Recls.combine_paths('a', 'b', 'c', 'd/e/f/', 'g', clean: false)
74
- assert_equal 'a/b/c/d/e/f/g', Recls.combine_paths('a', 'b', 'c', 'd/e/f/', 'g', clean: true)
75
85
 
76
- assert_equal 'a/b/c/../d/e/f/g', Recls.combine_paths('a', 'b', 'c', '..', 'd/e/f/', 'g', clean: false)
77
- assert_equal 'a/b/d/e/f/g', Recls.combine_paths('a', 'b', 'c', '..', 'd/e/f/', 'g/', clean: true)
78
- assert_equal 'a/b/d/e/f/g/', Recls.combine_paths('a', 'b', 'c', '..', 'd/e/f/', 'g/', canonicalise: true)
86
+ assert_equal 'a/b/c/d/e/f/g', Recls.combine_paths('a', 'b', 'c', 'd/e/f/', 'g', clean: false)
87
+ assert_equal 'a/b/c/d/e/f/g', Recls.combine_paths('a', 'b', 'c', 'd/e/f/', 'g', clean: true)
88
+
89
+ assert_equal 'a/b/c/../d/e/f/g', Recls.combine_paths('a', 'b', 'c', '..', 'd/e/f/', 'g', clean: false)
90
+ assert_equal 'a/b/d/e/f/g', Recls.combine_paths('a', 'b', 'c', '..', 'd/e/f/', 'g/', clean: true)
91
+ assert_equal 'a/b/d/e/f/g/', Recls.combine_paths('a', 'b', 'c', '..', 'd/e/f/', 'g/', canonicalise: true)
79
92
  end
80
93
  end
81
94
 
@@ -91,11 +104,22 @@ class Test_combine_paths < Test::Unit::TestCase
91
104
 
92
105
  assert_equal '/f/g', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', '/f/g')
93
106
  assert_equal '/f/g/', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', '/f/g/')
107
+
94
108
  if RUBY_VERSION >= '2'
95
- assert_equal '/f/g', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', '/f/g/', clean: true)
96
- assert_equal '/f/g/', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', '/f/g/', canonicalise: true)
109
+
110
+ assert_equal '/f/g', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', '/f/g/', clean: true)
111
+ assert_equal '/f/g/', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', '/f/g/', canonicalise: true)
97
112
  end
98
113
  end
114
+
115
+ def test_combining_with_entries
116
+
117
+ f_g = Recls.stat('/f/g', Recls::DETAILS_LATER)
118
+ b = Recls.stat('b', Recls::DETAILS_LATER)
119
+
120
+ assert_equal '/f/g', Recls.combine_paths('/', 'a', 'b', 'c', 'd/e', f_g)
121
+ assert_equal '/f/g', Recls.combine_paths('/', 'a', b, 'c', 'd/e', f_g)
122
+ end
99
123
  end
100
124
 
101
125
  class Test_canonicalise_path < Test::Unit::TestCase
@@ -128,6 +152,14 @@ class Test_canonicalise_path < Test::Unit::TestCase
128
152
  assert_equal('a', Recls.canonicalise_path('a'))
129
153
  assert_equal('file', Recls.canonicalise_path('file'))
130
154
  assert_equal('file.ext', Recls.canonicalise_path('file.ext'))
155
+
156
+ a = Recls.stat 'a', Recls::DETAILS_LATER
157
+ file = Recls.stat 'file', Recls::DETAILS_LATER
158
+ file_ext = Recls.stat 'file.ext', Recls::DETAILS_LATER
159
+
160
+ assert_equal(Recls.canonicalise_path(a.path), Recls.canonicalise_path(a))
161
+ assert_equal(Recls.canonicalise_path(file.path), Recls.canonicalise_path(file))
162
+ assert_equal(Recls.canonicalise_path(file_ext.path), Recls.canonicalise_path(file_ext))
131
163
  end
132
164
 
133
165
  def test_zero_parts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recls-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0.1
4
+ version: 2.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wilson