cmpfs-ruby 0.2.0 → 0.2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../../lib')
4
4
 
@@ -10,94 +10,95 @@ require 'test/unit'
10
10
  require 'stringio'
11
11
  require 'tempfile'
12
12
 
13
+
13
14
  class Test_CmpFS_Compare_compare_binary < Test::Unit::TestCase
14
15
 
15
- def test_compare_binary_identical_1
16
+ def test__compare_binary__identical_1
16
17
 
17
- lhs = StringIO.new 'abcdefghijiklmno'
18
- rhs_eq = StringIO.new 'abcdefghijiklmno'
18
+ lhs = StringIO.new 'abcdefghijiklmno'
19
+ rhs_eq = StringIO.new 'abcdefghijiklmno'
19
20
 
20
- assert CmpFS::Compare.compare_binary(lhs, rhs_eq), 'streams should be the same'
21
+ assert CmpFS::Compare.compare_binary(lhs, rhs_eq), 'streams should be the same'
21
22
 
22
- rhs_ne = StringIO.new 'abcdefghijiklmn'
23
+ rhs_ne = StringIO.new 'abcdefghijiklmn'
23
24
 
24
- assert_false CmpFS::Compare.compare_binary(lhs, rhs_ne), 'streams should not be the same'
25
- end
25
+ assert_false CmpFS::Compare.compare_binary(lhs, rhs_ne), 'streams should not be the same'
26
+ end
26
27
 
27
- def test_compare_binary_identical_2
28
+ def test__compare_binary__identical_2
28
29
 
29
- lhs_f = Tempfile.new('compare_binary-2')
30
+ lhs_f = Tempfile.new('compare_binary-2')
30
31
 
31
- begin
32
+ begin
32
33
 
33
- lhs_f << 'abcdefghijiklmno'
34
+ lhs_f << 'abcdefghijiklmno'
34
35
 
35
- lhs_f.rewind
36
- lhs_f.close
36
+ lhs_f.rewind
37
+ lhs_f.close
37
38
 
38
- rhs_eq = StringIO.new 'abcdefghijiklmno'
39
+ rhs_eq = StringIO.new 'abcdefghijiklmno'
39
40
 
40
- assert CmpFS::Compare.compare_binary(lhs_f.path, rhs_eq), 'streams should be the same'
41
+ assert CmpFS::Compare.compare_binary(lhs_f.path, rhs_eq), 'streams should be the same'
41
42
 
42
- rhs_ne = StringIO.new 'abcdefghijiklmnop'
43
+ rhs_ne = StringIO.new 'abcdefghijiklmnop'
43
44
 
44
- assert_false CmpFS::Compare.compare_binary(lhs_f.path, rhs_ne), 'streams should not be the same'
45
- ensure
45
+ assert_false CmpFS::Compare.compare_binary(lhs_f.path, rhs_ne), 'streams should not be the same'
46
+ ensure
46
47
 
47
- lhs_f.unlink
48
- end
49
- end
48
+ lhs_f.unlink
49
+ end
50
+ end
50
51
 
51
- def test_compare_binary_identical_3
52
+ def test__compare_binary__identical_3
52
53
 
53
- lhs_f = Tempfile.new('compare_binary-3')
54
+ lhs_f = Tempfile.new('compare_binary-3')
54
55
 
55
- begin
56
+ begin
56
57
 
57
- lhs_f << 'abcdefghijiklmno'
58
+ lhs_f << 'abcdefghijiklmno'
58
59
 
59
- lhs_f.rewind
60
- lhs_f.close
60
+ lhs_f.rewind
61
+ lhs_f.close
61
62
 
62
63
 
63
- rhs_eq_f = Tempfile.new('compare_binary-3')
64
+ rhs_eq_f = Tempfile.new('compare_binary-3')
64
65
 
65
- begin
66
+ begin
66
67
 
67
- rhs_eq_f << 'abcdefghijiklmno'
68
+ rhs_eq_f << 'abcdefghijiklmno'
68
69
 
69
- rhs_eq_f.rewind
70
- rhs_eq_f.close
70
+ rhs_eq_f.rewind
71
+ rhs_eq_f.close
71
72
 
72
- assert CmpFS::Compare.compare_binary(lhs_f.path, rhs_eq_f.path), 'streams should be the same'
73
- ensure
73
+ assert CmpFS::Compare.compare_binary(lhs_f.path, rhs_eq_f.path), 'streams should be the same'
74
+ ensure
74
75
 
75
- rhs_eq_f.unlink
76
- end
76
+ rhs_eq_f.unlink
77
+ end
77
78
 
78
79
 
79
- rhs_ne_f = Tempfile.new('compare_binary-3')
80
+ rhs_ne_f = Tempfile.new('compare_binary-3')
80
81
 
81
- begin
82
+ begin
82
83
 
83
- rhs_ne_f << 'xyz'
84
+ rhs_ne_f << 'xyz'
84
85
 
85
- rhs_ne_f.rewind
86
- rhs_ne_f.close
86
+ rhs_ne_f.rewind
87
+ rhs_ne_f.close
87
88
 
88
- assert_false CmpFS::Compare.compare_binary(lhs_f.path, rhs_ne_f.path), 'streams should not be the same'
89
- ensure
89
+ assert_false CmpFS::Compare.compare_binary(lhs_f.path, rhs_ne_f.path), 'streams should not be the same'
90
+ ensure
90
91
 
91
- rhs_ne_f.unlink
92
- end
92
+ rhs_ne_f.unlink
93
+ end
93
94
 
94
- ensure
95
+ ensure
95
96
 
96
- lhs_f.unlink
97
- end
98
- end
97
+ lhs_f.unlink
98
+ end
99
+ end
99
100
  end
100
101
 
101
- # ############################## end of file ############################# #
102
102
 
103
+ # ############################## end of file ############################# #
103
104
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../lib')
4
4
 
@@ -10,98 +10,97 @@ require 'test/unit'
10
10
  require 'stringio'
11
11
  require 'tempfile'
12
12
 
13
- class Test_CmpFS_compare_binary < Test::Unit::TestCase
14
-
15
- include ::CmpFS
16
13
 
17
- def test_compare_binary_identical_1
14
+ class Test_CmpFS_compare_binary < Test::Unit::TestCase
18
15
 
19
- lhs = StringIO.new 'abcdefghijiklmno'
20
- rhs_eq = StringIO.new 'abcdefghijiklmno'
16
+ include ::CmpFS
21
17
 
22
- assert compare_binary(lhs, rhs_eq), 'streams should be the same'
18
+ def test__compare_binary__identical_1
23
19
 
24
- rhs_ne = StringIO.new 'abcdefghijiklmn'
20
+ lhs = StringIO.new 'abcdefghijiklmno'
21
+ rhs_eq = StringIO.new 'abcdefghijiklmno'
25
22
 
26
- assert_false compare_binary(lhs, rhs_ne), 'streams should not be the same'
27
- end
23
+ assert compare_binary(lhs, rhs_eq), 'streams should be the same'
28
24
 
29
- def test_compare_binary_identical_2
25
+ rhs_ne = StringIO.new 'abcdefghijiklmn'
30
26
 
31
- lhs_f = Tempfile.new('compare_binary-2')
27
+ assert_false compare_binary(lhs, rhs_ne), 'streams should not be the same'
28
+ end
32
29
 
33
- begin
30
+ def test__compare_binary__identical_2
34
31
 
35
- lhs_f << 'abcdefghijiklmno'
32
+ lhs_f = Tempfile.new('compare_binary-2')
36
33
 
37
- lhs_f.rewind
38
- lhs_f.close
34
+ begin
39
35
 
40
- rhs_eq = StringIO.new 'abcdefghijiklmno'
36
+ lhs_f << 'abcdefghijiklmno'
41
37
 
42
- assert compare_binary(lhs_f.path, rhs_eq), 'streams should be the same'
38
+ lhs_f.rewind
39
+ lhs_f.close
43
40
 
44
- rhs_ne = StringIO.new 'abcdefghijiklmnop'
41
+ rhs_eq = StringIO.new 'abcdefghijiklmno'
45
42
 
46
- assert_false compare_binary(lhs_f.path, rhs_ne), 'streams should not be the same'
47
- ensure
43
+ assert compare_binary(lhs_f.path, rhs_eq), 'streams should be the same'
48
44
 
49
- lhs_f.unlink
50
- end
51
- end
45
+ rhs_ne = StringIO.new 'abcdefghijiklmnop'
52
46
 
53
- def test_compare_binary_identical_3
47
+ assert_false compare_binary(lhs_f.path, rhs_ne), 'streams should not be the same'
48
+ ensure
54
49
 
55
- lhs_f = Tempfile.new('compare_binary-3')
50
+ lhs_f.unlink
51
+ end
52
+ end
56
53
 
57
- begin
54
+ def test__compare_binary__identical_3
58
55
 
59
- lhs_f << 'abcdefghijiklmno'
56
+ lhs_f = Tempfile.new('compare_binary-3')
60
57
 
61
- lhs_f.rewind
62
- lhs_f.close
58
+ begin
63
59
 
60
+ lhs_f << 'abcdefghijiklmno'
64
61
 
65
- rhs_eq_f = Tempfile.new('compare_binary-3')
62
+ lhs_f.rewind
63
+ lhs_f.close
66
64
 
67
- begin
68
65
 
69
- rhs_eq_f << 'abcdefghijiklmno'
66
+ rhs_eq_f = Tempfile.new('compare_binary-3')
70
67
 
71
- rhs_eq_f.rewind
72
- rhs_eq_f.close
68
+ begin
73
69
 
70
+ rhs_eq_f << 'abcdefghijiklmno'
74
71
 
75
- assert compare_binary(lhs_f.path, rhs_eq_f.path), 'streams should be the same'
76
- ensure
72
+ rhs_eq_f.rewind
73
+ rhs_eq_f.close
77
74
 
78
- rhs_eq_f.unlink
79
- end
75
+ assert compare_binary(lhs_f.path, rhs_eq_f.path), 'streams should be the same'
76
+ ensure
80
77
 
78
+ rhs_eq_f.unlink
79
+ end
81
80
 
82
- rhs_ne_f = Tempfile.new('compare_binary-3')
83
81
 
84
- begin
82
+ rhs_ne_f = Tempfile.new('compare_binary-3')
85
83
 
86
- rhs_ne_f << 'xyz'
84
+ begin
87
85
 
88
- rhs_ne_f.rewind
89
- rhs_ne_f.close
86
+ rhs_ne_f << 'xyz'
90
87
 
88
+ rhs_ne_f.rewind
89
+ rhs_ne_f.close
91
90
 
92
- assert_false compare_binary(lhs_f.path, rhs_ne_f.path), 'streams should not be the same'
93
- ensure
91
+ assert_false compare_binary(lhs_f.path, rhs_ne_f.path), 'streams should not be the same'
92
+ ensure
94
93
 
95
- rhs_ne_f.unlink
96
- end
94
+ rhs_ne_f.unlink
95
+ end
97
96
 
98
- ensure
97
+ ensure
99
98
 
100
- lhs_f.unlink
101
- end
102
- end
99
+ lhs_f.unlink
100
+ end
101
+ end
103
102
  end
104
103
 
105
- # ############################## end of file ############################# #
106
104
 
105
+ # ############################## end of file ############################# #
107
106
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../lib')
4
4
 
@@ -10,56 +10,110 @@ require 'test/unit'
10
10
  require 'stringio'
11
11
  require 'tempfile'
12
12
 
13
+
13
14
  class Test_CmpFS_compare_text < Test::Unit::TestCase
14
15
 
15
- include ::CmpFS
16
+ include ::CmpFS
17
+
18
+ def test__compare_text__empty
19
+
20
+ lhs = StringIO.new
21
+ rhs_eq = StringIO.new
22
+
23
+ assert compare_text(lhs, rhs_eq), 'streams should be the same'
24
+ end
25
+
26
+ def test__compare_text__blank_lines
27
+
28
+ lhs = StringIO.new <<END_OF_INPUT
29
+
30
+
31
+ END_OF_INPUT
32
+ rhs_eq = StringIO.new <<END_OF_INPUT
33
+
16
34
 
17
- def test_compare_text_identical_1
35
+ END_OF_INPUT
18
36
 
19
- lhs = StringIO.new
20
- rhs_eq = StringIO.new
37
+ assert compare_text(lhs, rhs_eq), 'streams should be the same'
38
+ end
21
39
 
22
- lhs << "line-1\n"
23
- rhs_eq << "line-1\n"
40
+ def test__compare_text__identical_lines_1
24
41
 
25
- lhs << "line-2\n"
26
- rhs_eq << "line-2\n"
42
+ lhs = StringIO.new <<END_OF_INPUT
43
+ line-1
44
+ line-2
27
45
 
28
- assert compare_text(lhs, rhs_eq), 'streams should be the same'
46
+ END_OF_INPUT
47
+ rhs_eq = StringIO.new <<END_OF_INPUT
48
+ line-1
49
+ line-2
29
50
 
30
- rhs_ne = StringIO.new
51
+ END_OF_INPUT
31
52
 
32
- rhs_ne << "line-1\n"
33
- rhs_ne << "line2\n"
53
+ assert compare_text(lhs, rhs_eq), 'streams should be the same'
54
+ end
34
55
 
35
- assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
36
- end
56
+ def test__compare_text__different_lines_1
37
57
 
38
- def test_compare_text_same_with_blank_lines_1
58
+ lhs = StringIO.new <<END_OF_INPUT
59
+ line-1
60
+ line-2
39
61
 
40
- lhs = StringIO.new
41
- rhs_eq = StringIO.new
62
+ END_OF_INPUT
63
+ rhs_ne = StringIO.new <<END_OF_INPUT
64
+ line-1
65
+ line2
42
66
 
43
- lhs << "line-1\n"
44
- lhs << "\n"
45
- rhs_eq << "line-1\n"
67
+ END_OF_INPUT
46
68
 
47
- lhs << " line-2\n"
48
- rhs_eq << "line-2\n"
69
+ assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
70
+ end
49
71
 
50
- assert_false compare_text(lhs, rhs_eq), 'streams should not be the same'
51
- assert compare_text(lhs, rhs_eq, trim_lines: true, skip_blank_lines: true), 'streams should be the same'
72
+ def test__compare_text__different_lines_2
52
73
 
53
- rhs_ne = StringIO.new
74
+ lhs = StringIO.new <<END_OF_INPUT
75
+ line-1
54
76
 
55
- rhs_ne << "line-1\n"
56
- rhs_ne << "line2\n"
77
+ line-2
78
+ END_OF_INPUT
79
+ rhs_ne = StringIO.new <<END_OF_INPUT
80
+ line-1
81
+ line-2
57
82
 
58
- assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
59
- end
83
+ END_OF_INPUT
60
84
 
85
+ assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
86
+ end
87
+
88
+ def test__compare_text__different_streams_with_permutations_of_trim_and_skip_1
89
+
90
+ lhs = StringIO.new <<END_OF_INPUT
91
+ line-1
92
+
93
+ line-2
94
+ END_OF_INPUT
95
+ rhs_eq = StringIO.new <<END_OF_INPUT
96
+ line-1
97
+ line-2
98
+ END_OF_INPUT
99
+
100
+ assert_false compare_text(lhs, rhs_eq), 'streams should not be the same'
101
+ assert_false compare_text(lhs, rhs_eq, trim_lines: false, skip_blank_lines: true), 'streams should not be the same'
102
+ assert_false compare_text(lhs, rhs_eq, trim_lines: true, skip_blank_lines: false), 'streams should not be the same'
103
+ assert compare_text(lhs, rhs_eq, trim_lines: true, skip_blank_lines: true), 'streams should be the same'
104
+
105
+ rhs_ne = StringIO.new <<END_OF_INPUT
106
+ line-1
107
+ line2
108
+ END_OF_INPUT
109
+
110
+ assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
111
+ assert_false compare_text(lhs, rhs_ne, trim_lines: false, skip_blank_lines: true), 'streams should not be the same'
112
+ assert_false compare_text(lhs, rhs_ne, trim_lines: true, skip_blank_lines: false), 'streams should not be the same'
113
+ assert_false compare_text(lhs, rhs_ne, trim_lines: true, skip_blank_lines: true), 'streams should not be the same'
114
+ end
61
115
  end
62
116
 
63
- # ############################## end of file ############################# #
64
117
 
118
+ # ############################## end of file ############################# #
65
119
 
@@ -1,4 +1,4 @@
1
- #! /usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), '../../lib')
4
4
 
@@ -9,29 +9,32 @@ require 'test/unit'
9
9
 
10
10
  class Test_version < Test::Unit::TestCase
11
11
 
12
- def test_has_VERSION
12
+ def test__VERSION
13
13
 
14
- assert defined? CmpFS::VERSION
15
- end
14
+ assert defined? CmpFS::VERSION
15
+ end
16
16
 
17
- def test_has_VERSION_MAJOR
17
+ def test__VERSION_MAJOR
18
18
 
19
- assert defined? CmpFS::VERSION_MAJOR
20
- end
19
+ assert defined? CmpFS::VERSION_MAJOR
20
+ end
21
21
 
22
- def test_has_VERSION_MINOR
22
+ def test__VERSION_MINOR
23
23
 
24
- assert defined? CmpFS::VERSION_MINOR
25
- end
24
+ assert defined? CmpFS::VERSION_MINOR
25
+ end
26
26
 
27
- def test_has_VERSION_REVISION
27
+ def test__VERSION_REVISION
28
28
 
29
- assert defined? CmpFS::VERSION_REVISION
30
- end
29
+ assert defined? CmpFS::VERSION_REVISION
30
+ end
31
31
 
32
- def test_VERSION_has_consistent_format
32
+ def test__VERSION_has_consistent_format
33
33
 
34
- assert_equal CmpFS::VERSION, "#{CmpFS::VERSION_MAJOR}.#{CmpFS::VERSION_MINOR}.#{CmpFS::VERSION_PATCH}"
35
- end
34
+ version = CmpFS::VERSION
35
+ j_n_p = "#{CmpFS::VERSION_MAJOR}.#{CmpFS::VERSION_MINOR}.#{CmpFS::VERSION_PATCH}"
36
+
37
+ assert_match /^#{j_n_p}(|\..+)$/, version
38
+ end
36
39
  end
37
40
 
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmpfs-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wilson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-13 00:00:00.000000000 Z
11
+ date: 2024-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xqsr3
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.31'
19
+ version: '0.39'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.39.1
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ~>
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.39'
30
+ - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '0.31'
32
+ version: 0.39.1
27
33
  description: |
28
34
  Compare File-System entities, for Ruby is a library that provides comparison
29
35
  functions for file-system entities - files and streams - including binary and
@@ -33,43 +39,42 @@ executables: []
33
39
  extensions: []
34
40
  extra_rdoc_files: []
35
41
  files:
42
+ - LICENSE
43
+ - README.md
44
+ - lib/cmpfs.rb
45
+ - lib/cmpfs/compare.rb
36
46
  - lib/cmpfs/compare/api_1_9.rb
37
47
  - lib/cmpfs/compare/api_2.rb
38
48
  - lib/cmpfs/compare/binary/internal_.rb
39
49
  - lib/cmpfs/compare/text/internal_.rb
40
- - lib/cmpfs/compare.rb
41
50
  - lib/cmpfs/version.rb
42
- - lib/cmpfs.rb
43
51
  - test/unit/compare/tc_compare_binary.rb
44
52
  - test/unit/compare/ts_all.rb
45
53
  - test/unit/tc_compare_binary.rb
46
54
  - test/unit/tc_compare_text.rb
47
55
  - test/unit/tc_version.rb
48
56
  - test/unit/ts_all.rb
49
- - README.md
50
- - LICENSE
51
57
  homepage: http://github.com/synesissoftware/cmpfs.Ruby
52
58
  licenses:
53
59
  - BSD 3-Clause
54
60
  metadata: {}
55
- post_install_message:
61
+ post_install_message:
56
62
  rdoc_options: []
57
63
  require_paths:
58
64
  - lib
59
65
  required_ruby_version: !ruby/object:Gem::Requirement
60
66
  requirements:
61
- - - ~>
67
+ - - "~>"
62
68
  - !ruby/object:Gem::Version
63
69
  version: '2.0'
64
70
  required_rubygems_version: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - '>='
72
+ - - ">="
67
73
  - !ruby/object:Gem::Version
68
74
  version: '0'
69
75
  requirements: []
70
- rubyforge_project:
71
- rubygems_version: 2.0.14.1
72
- signing_key:
76
+ rubygems_version: 3.3.7
77
+ signing_key:
73
78
  specification_version: 4
74
79
  summary: CmpFS.Ruby
75
80
  test_files: []