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 +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +2 -4
- data/lib/simplecov/compare/version.rb +1 -1
- data/lib/simplecov/compare.rb +9 -0
- data/test/simplecov/compare_test.rb +23 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7ec00dedbd96313e447c4d4cd4b229cc6580a0b7594e695b37fa671a47c790b
|
|
4
|
+
data.tar.gz: 75cf2e34a0ad0e6da31f7d0c2a476c17fe7e3a21c2cd45cf139e6c432f07481e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a1bd555a0a92a6b2cc614b914a2c323ddc5aa012fee89c5796bed1dbd36f317dadb006d8f8b5f76adb4de0480a48e2bd6d014eaa040b023ec5d0bb62b509ee9
|
|
7
|
+
data.tar.gz: 2176c41b305a0707e1e6043a5aa11416047344e19d9afa760a8c8699ffff02ae93633f43758f6ab24ca2b114ff6692bb19ce067006d167ef6e4fcecbba46ebe0
|
data/CHANGELOG.md
ADDED
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
|
|
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
|
|
18
|
+
gem install simplecov-compare
|
|
21
19
|
```
|
|
22
20
|
|
|
23
21
|
## Usage
|
data/lib/simplecov/compare.rb
CHANGED
|
@@ -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.
|
|
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
|