coverband 5.2.3 → 5.2.3.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b86ea2f59a09e6e1aa19962a0c040a799c779ad315ddb4638f83a00e1ce83d6b
|
4
|
+
data.tar.gz: 4b7ec38f2f1907cd0403ac6202f945a177afb745c8ee914ac4e10d7643f39bee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af8fdb3b98d8350cabf01e5ddca9321fccd838e4da80ef5260cde7d4e31c17041707e703761193d27b35f1ba1ea3c7363843b80506a7dfa7152ceb82ac5b68bc
|
7
|
+
data.tar.gz: 12f81c55f8bec44ebaf4fc4296484de0c28acae104f546240b278ffb27fbcd9775c03ddc803d1e5234a34fdcd1a8c579dd08808d732b67982d520c5d9aec17bd
|
@@ -5,7 +5,7 @@ module Coverband
|
|
5
5
|
class FileHasher
|
6
6
|
@cache = {}
|
7
7
|
|
8
|
-
def self.
|
8
|
+
def self.hash_file(file, path_converter: AbsoluteFileConverter.instance)
|
9
9
|
@cache[file] ||= begin
|
10
10
|
file = path_converter.convert(file)
|
11
11
|
Digest::MD5.file(file).hexdigest if File.exist?(file)
|
data/lib/coverband/version.rb
CHANGED
@@ -6,17 +6,17 @@ module Coverband
|
|
6
6
|
module Utils
|
7
7
|
class FileHasherTest < Minitest::Test
|
8
8
|
def test_hash_same_file
|
9
|
-
refute_nil FileHasher.
|
10
|
-
assert_equal(FileHasher.
|
11
|
-
assert_equal(FileHasher.
|
9
|
+
refute_nil FileHasher.hash_file("./test/dog.rb")
|
10
|
+
assert_equal(FileHasher.hash_file("./test/dog.rb"), FileHasher.hash_file("./test/dog.rb"))
|
11
|
+
assert_equal(FileHasher.hash_file(File.expand_path("./test/dog.rb")), FileHasher.hash_file("./test/dog.rb"))
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_hash_different_files
|
15
|
-
refute_equal(FileHasher.
|
15
|
+
refute_equal(FileHasher.hash_file("./test/dog.rb"), FileHasher.hash_file("./lib/coverband.rb"))
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_hash_file_not_exists
|
19
|
-
assert_nil(FileHasher.
|
19
|
+
assert_nil(FileHasher.hash_file("./made_up_file.py"))
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/test/test_helper.rb
CHANGED
@@ -100,7 +100,7 @@ def test(name, &block)
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def mock_file_hash(hash: "abcd")
|
103
|
-
Coverband::Utils::FileHasher.expects(:
|
103
|
+
Coverband::Utils::FileHasher.expects(:hash_file).at_least_once.returns(hash)
|
104
104
|
end
|
105
105
|
|
106
106
|
def example_line
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coverband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.3
|
4
|
+
version: 5.2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Mayer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-07-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: benchmark-ips
|
@@ -499,7 +499,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
499
499
|
- !ruby/object:Gem::Version
|
500
500
|
version: '0'
|
501
501
|
requirements: []
|
502
|
-
rubygems_version: 3.
|
502
|
+
rubygems_version: 3.2.32
|
503
503
|
signing_key:
|
504
504
|
specification_version: 4
|
505
505
|
summary: Rack middleware to measure production code usage (LOC runtime usage)
|