simplecov-compare 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1c84aeb5ca7098e9ef46d238a442ff1033e3ab9591cb035b010a51db6e64cf0
4
- data.tar.gz: de4cdfdf2bd6ad0dddffba37a480c0f14d26a51b93721628bf43ebeabe51529f
3
+ metadata.gz: d7ec00dedbd96313e447c4d4cd4b229cc6580a0b7594e695b37fa671a47c790b
4
+ data.tar.gz: 75cf2e34a0ad0e6da31f7d0c2a476c17fe7e3a21c2cd45cf139e6c432f07481e
5
5
  SHA512:
6
- metadata.gz: 8243f62a3094c48af6fd763fbaece4ac75a5d4a54b38e01154ff609ac4ecd868e3a455b12d7fc552d1e3aa839240ba292065d2d4d8dc52227602e0fc2014e066
7
- data.tar.gz: d9ff76b1d1035420e950fc5b5ceb2a4affc74cd68f024c39cfdd1493e3ff6c308e9546b1ff39a1427a5986baf2271d9b279c38fedab2fc7b191b1df1b6456378
6
+ metadata.gz: 5a1bd555a0a92a6b2cc614b914a2c323ddc5aa012fee89c5796bed1dbd36f317dadb006d8f8b5f76adb4de0480a48e2bd6d014eaa040b023ec5d0bb62b509ee9
7
+ data.tar.gz: 2176c41b305a0707e1e6043a5aa11416047344e19d9afa760a8c8699ffff02ae93633f43758f6ab24ca2b114ff6692bb19ce067006d167ef6e4fcecbba46ebe0
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ ## Current release (in development)
2
+
3
+ ## 0.1.1 [2026-03-08]
4
+
5
+ * Add checks that file paths are provided
6
+
7
+ *Kevin Murphy*
8
+
9
+ ## 0.1.0 [2026-03-08]
10
+
11
+ * Initial Release
12
+
13
+ *Kevin Murphy*
data/README.md CHANGED
@@ -6,18 +6,16 @@ mechanism to compare two Simplecov results.
6
6
 
7
7
  ## Installation
8
8
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
9
  Install the gem and add to the application's Gemfile by executing:
12
10
 
13
11
  ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
12
+ bundle add simplecov-compare
15
13
  ```
16
14
 
17
15
  If bundler is not being used to manage dependencies, install the gem by executing:
18
16
 
19
17
  ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
+ gem install simplecov-compare
21
19
  ```
22
20
 
23
21
  ## Usage
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Simplecov
4
4
  module Compare
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -13,7 +13,16 @@ require_relative "compare/result_set_comparison"
13
13
 
14
14
  module Simplecov
15
15
  module Compare
16
+ class NoPathError < StandardError
17
+ def initialize(msg="Required path not provided")
18
+ super
19
+ end
20
+ end
21
+
16
22
  def self.report(base_path:, to_path:, formatter_class: Formatter::MarkdownFormatter, reporter_class: Reporter::GlamourReporter)
23
+ raise NoPathError, "Base path not provided" if base_path.nil?
24
+ raise NoPathError, "To path not provided" if to_path.nil?
25
+
17
26
  base = ResultSet.new(ResultFile.new(base_path).coverage_data)
18
27
  other = ResultSet.new(ResultFile.new(to_path).coverage_data)
19
28
  comparison = ResultSetComparison.new(base, to: other)
@@ -32,6 +32,29 @@ describe Simplecov::Compare do
32
32
  )
33
33
  end
34
34
  end
35
+
36
+ it "raises an exception when no base path is provided" do
37
+ assert_raises(Simplecov::Compare::NoPathError, "Base path not provided") do
38
+ Simplecov::Compare.report(
39
+ base_path: nil,
40
+ to_path: "test/fixtures/sample_resultset.json",
41
+ formatter_class: Simplecov::Compare::Formatter::MarkdownFormatter,
42
+ reporter_class: Simplecov::Compare::Reporter::SimpleReporter,
43
+ )
44
+ end
45
+
46
+ end
47
+
48
+ it "raises an exception when no to path is provided" do
49
+ assert_raises(Simplecov::Compare::NoPathError, "To path not provided") do
50
+ Simplecov::Compare.report(
51
+ base_path: "test/fixtures/sample_resultset.json",
52
+ to_path: nil,
53
+ formatter_class: Simplecov::Compare::Formatter::MarkdownFormatter,
54
+ reporter_class: Simplecov::Compare::Reporter::SimpleReporter,
55
+ )
56
+ end
57
+ end
35
58
  end
36
59
 
37
60
  it "has a version number" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-compare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Murphy
@@ -31,6 +31,7 @@ executables:
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - CHANGELOG.md
34
35
  - CODE_OF_CONDUCT.md
35
36
  - LICENSE.txt
36
37
  - README.md