minitest-bonus-assertions 3.0 → 3.1.0
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 +5 -5
- data/CHANGELOG.md +61 -0
- data/CONTRIBUTING.md +124 -0
- data/CONTRIBUTORS.md +10 -0
- data/LICENCE.md +51 -0
- data/Manifest.txt +10 -12
- data/README.md +77 -0
- data/Rakefile +66 -58
- data/SECURITY.md +30 -0
- data/lib/minitest/assertion_tests.rb +4 -4
- data/lib/minitest/bonus_assertions/version.rb +5 -0
- data/lib/minitest/bonus_assertions.rb +233 -0
- data/lib/minitest-bonus-assertions.rb +2 -229
- data/licences/dco.txt +34 -0
- data/test/minitest_config.rb +4 -8
- data/test/test_minitest-bonus-assertions.rb +176 -123
- metadata +84 -166
- data/.autotest +0 -5
- data/.document +0 -5
- data/.gemtest +0 -1
- data/.minitest.rb +0 -2
- data/.travis.yml +0 -30
- data/.workenv +0 -5
- data/Contributing.rdoc +0 -67
- data/Gemfile +0 -9
- data/History.rdoc +0 -48
- data/Licence.rdoc +0 -28
- data/README.rdoc +0 -77
- /data/{Code-of-Conduct.rdoc → CODE_OF_CONDUCT.md} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 10beaa1635b0f5ee13ae3af7323ae111b5ca1b5e630093155b3c5199d325cbdb
|
|
4
|
+
data.tar.gz: 81d714deaf6243c0b77223982e793aad342ef5ec86037eadf25af5ac7fa83478
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1366140677c5ec6ba415e2735eff31dba488d9771b00c14ddf52cab86dd470e489c94b29586ecfcc2e25aea20e9e4e1beae26feacc73f150c41fc6387a3f18a4
|
|
7
|
+
data.tar.gz: 0b81476425808c8c23c2f089c77ce7db359f5fca5f2dc784cf2fa132d227e557a7e6c9c69071d9e222b691ef2dfd44240b57cc3d904dbba64a897786be2b5b0c
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# `minitest-bonus-assertions` Changelog
|
|
2
|
+
|
|
3
|
+
## 3.1.0 / 2026-04-06
|
|
4
|
+
|
|
5
|
+
- Josef Šimánek ([@simi][@simi]) fixed an improper self-dependency in
|
|
6
|
+
[#3][issue-3].
|
|
7
|
+
|
|
8
|
+
- Modernized. While I have not changed most of the dependencies, I will no
|
|
9
|
+
longer guarantee that this works on any version less than Ruby 3.2.
|
|
10
|
+
|
|
11
|
+
## 3.0 / 2017-04-26
|
|
12
|
+
|
|
13
|
+
- 1 major enhancement
|
|
14
|
+
|
|
15
|
+
- Dropped support for Ruby 1.9.
|
|
16
|
+
|
|
17
|
+
- 1 minor enhancement
|
|
18
|
+
|
|
19
|
+
- Added assertion `assert_result_equal` (expectation `must_equal_result`) to
|
|
20
|
+
be ready for Minitest 6. This will allow those who have legitimate cases
|
|
21
|
+
where they do not know whether the expected is nil or not to have a
|
|
22
|
+
meaningful test and silence deprecation warnings.
|
|
23
|
+
|
|
24
|
+
## 2.0 / 2015-10-19
|
|
25
|
+
|
|
26
|
+
- 1 major enhancement
|
|
27
|
+
|
|
28
|
+
- Added Minitest::AssertionTests to assist with testing newly added
|
|
29
|
+
assertions, even for other gems. Previously, a variant of what is provided
|
|
30
|
+
was present in `test/minitest_config.rb`.
|
|
31
|
+
|
|
32
|
+
- 2 minor enhancements
|
|
33
|
+
|
|
34
|
+
- Made the expectation `must_be_between` ready for the next version of
|
|
35
|
+
Minitest by calling `assert_between` on the test context (`ctx`) rather than
|
|
36
|
+
on the bare object under test. Because of this change,
|
|
37
|
+
`minitest-bonus-assertions` is now tested for compatibility only with
|
|
38
|
+
`minitest` 5.8 or higher.
|
|
39
|
+
|
|
40
|
+
- Added `assert_set_equal` and `refute_set_equal` (with expectation forms of
|
|
41
|
+
`must_equal_set` and `must_not_equal_set`) to test enumerable values for set
|
|
42
|
+
equality.
|
|
43
|
+
|
|
44
|
+
- 1 minor bug fix
|
|
45
|
+
|
|
46
|
+
- The documentation for `assert_between` was unclear; it is a
|
|
47
|
+
boundary-exclusive test, not a boundary-inclusive test. That is, it is
|
|
48
|
+
`lo < exp < hi`, not `lo <= exp <= hi`.
|
|
49
|
+
|
|
50
|
+
- 1 governance change
|
|
51
|
+
|
|
52
|
+
- This project now has a [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
53
|
+
|
|
54
|
+
## 1.0 / 2015-03-05
|
|
55
|
+
|
|
56
|
+
- 1 major enhancement
|
|
57
|
+
|
|
58
|
+
- Birthday!
|
|
59
|
+
|
|
60
|
+
[@simi]: https://github.com/simi
|
|
61
|
+
[issue-3]: https://github.com/halostatue/minitest-bonus-assertions/issues/3
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contribution to `minitest-bonus-assertions` is encouraged: bug reports, feature
|
|
4
|
+
requests, or code contributions. New features should be proposed and discussed
|
|
5
|
+
in an [issue][issues].
|
|
6
|
+
|
|
7
|
+
Before contributing patches, please read the [Licence](./LICENCE.md).
|
|
8
|
+
|
|
9
|
+
`minitest-bonus-assertions` is governed under the
|
|
10
|
+
[Contributor Covenant Code of Conduct][cccoc].
|
|
11
|
+
|
|
12
|
+
## Code Guidelines
|
|
13
|
+
|
|
14
|
+
I have several guidelines to contributing code through pull requests:
|
|
15
|
+
|
|
16
|
+
- All code changes require tests. In most cases, this will be added or updated
|
|
17
|
+
unit tests. I use [Minitest][minitest].
|
|
18
|
+
|
|
19
|
+
- I use code formatters, static analysis tools, and linting to ensure consistent
|
|
20
|
+
styles and formatting. There should be no warning output from test run
|
|
21
|
+
processes. I use [Standard Ruby][standardrb].
|
|
22
|
+
|
|
23
|
+
- Proposed changes should be on a thoughtfully-named topic branch and organized
|
|
24
|
+
into logical commit chunks as appropriate.
|
|
25
|
+
|
|
26
|
+
- Use [Conventional Commits][conventional] with my
|
|
27
|
+
[conventions](#commit-conventions).
|
|
28
|
+
|
|
29
|
+
- Versions must not be updated in pull requests unless otherwise directed. This
|
|
30
|
+
means that you must not:
|
|
31
|
+
|
|
32
|
+
- Modify `VERSION` in `lib/minitest/bonus_assertions/version.rb`. When your
|
|
33
|
+
patch is accepted and a release is made, the version will be updated at that
|
|
34
|
+
point.
|
|
35
|
+
|
|
36
|
+
- Modify `minitest-bonus-assertions.gemspec`; it is a generated file. (You
|
|
37
|
+
_may_ use `rake gemspec` to regenerate it if your change involves metadata
|
|
38
|
+
related to gem itself).
|
|
39
|
+
|
|
40
|
+
- Modify the `Gemfile`.
|
|
41
|
+
|
|
42
|
+
- Documentation should be added or updated as appropriate for new or updated
|
|
43
|
+
functionality. The documentation is RDoc; `minitest-bonus-assertions` does not
|
|
44
|
+
use extensions that may be present in alternative documentation generators.
|
|
45
|
+
|
|
46
|
+
- All GitHub Actions checks marked as required must pass before a pull request
|
|
47
|
+
may be accepted and merged.
|
|
48
|
+
|
|
49
|
+
- Add your name or GitHub handle to `CONTRIBUTORS.md` and a record in the
|
|
50
|
+
`CHANGELOG.md` as a separate commit from your main change. (Follow the style
|
|
51
|
+
in the `CHANGELOG.md` and provide a link to your PR.)
|
|
52
|
+
|
|
53
|
+
- Include your DCO sign-off in each commit message (see [LICENCE](LICENCE.md)).
|
|
54
|
+
|
|
55
|
+
## AI Contribution Policy
|
|
56
|
+
|
|
57
|
+
`minitest-bonus-assertions` is a mature library. It is extremely important that
|
|
58
|
+
contributions of any sort be well understood by the submitter and that the
|
|
59
|
+
developer can attest to the [Developer Certificate of Origin][dco] for each pull
|
|
60
|
+
request (see [LICENCE](LICENCE.md)).
|
|
61
|
+
|
|
62
|
+
Any contribution (bug, feature request, or pull request) that uses undeclared AI
|
|
63
|
+
output will be rejected.
|
|
64
|
+
|
|
65
|
+
## Test Dependencies
|
|
66
|
+
|
|
67
|
+
`minitest-bonus-assertions` uses Ryan Davis's [Hoe][Hoe] to manage the release
|
|
68
|
+
process, and it adds a number of rake tasks. You will mostly be interested in
|
|
69
|
+
`rake`, which runs the tests the same way that `rake test` will do.
|
|
70
|
+
|
|
71
|
+
To assist with the installation of the development dependencies for
|
|
72
|
+
`minitest-bonus-assertions`, I have provided the simplest possible Gemfile
|
|
73
|
+
pointing to the (generated) `minitest-bonus-assertions.gemspec` file. This will
|
|
74
|
+
permit you to do `bundle install` to get the development dependencies.
|
|
75
|
+
|
|
76
|
+
You can run tests with code coverage analysis by running `rake coverage`.
|
|
77
|
+
|
|
78
|
+
## Commit Conventions
|
|
79
|
+
|
|
80
|
+
`minitest-bonus-assertions` has adopted a variation of the Conventional Commits
|
|
81
|
+
format for commit messages. The following types are permitted:
|
|
82
|
+
|
|
83
|
+
| Type | Purpose |
|
|
84
|
+
| ------- | ----------------------------------------------------- |
|
|
85
|
+
| `feat` | A new feature |
|
|
86
|
+
| `fix` | A bug fix |
|
|
87
|
+
| `chore` | A code change that is neither a bug fix nor a feature |
|
|
88
|
+
| `docs` | Documentation updates |
|
|
89
|
+
| `deps` | Dependency updates, including GitHub Actions. |
|
|
90
|
+
|
|
91
|
+
I encourage the use of [Tim Pope's][tpope-qcm] or [Chris Beam's][cbeams]
|
|
92
|
+
guidelines on the writing of commit messages
|
|
93
|
+
|
|
94
|
+
I require the use of [git][trailers1] [trailers][trailers2] for specific
|
|
95
|
+
additional metadata and strongly encourage it for others. The conditionally
|
|
96
|
+
required metadata trailers are:
|
|
97
|
+
|
|
98
|
+
- `Breaking-Change`: if the change is a breaking change. **Do not** use the
|
|
99
|
+
shorthand form (`feat!(scope)`) or `BREAKING CHANGE`.
|
|
100
|
+
|
|
101
|
+
- `Signed-off-by`: this is required for all developers except me, as outlined in
|
|
102
|
+
the [Licence](./LICENCE.md#developer-certificate-of-origin).
|
|
103
|
+
|
|
104
|
+
- `Fixes` or `Resolves`: If a change fixes one or more open [issues][issues],
|
|
105
|
+
that issue must be included in the `Fixes` or `Resolves` trailer. Multiple
|
|
106
|
+
issues should be listed comma separated in the same trailer:
|
|
107
|
+
`Fixes: #1, #5, #7`, but _may_ appear in separate trailers. While both `Fixes`
|
|
108
|
+
and `Resolves` are synonyms, only _one_ should be used in a given commit or
|
|
109
|
+
pull request.
|
|
110
|
+
|
|
111
|
+
- `Related to`: If a change does not fix an issue, those issue references should
|
|
112
|
+
be included in this trailer.
|
|
113
|
+
|
|
114
|
+
[cbeams]: https://cbea.ms/git-commit/
|
|
115
|
+
[cccoc]: ./CODE_OF_CONDUCT.md
|
|
116
|
+
[conventional]: https://www.conventionalcommits.org/en/v1.0.0/
|
|
117
|
+
[dco]: licences/dco.txt
|
|
118
|
+
[hoe]: https://github.com/seattlerb/hoe
|
|
119
|
+
[issues]: https://github.com/halostatue/minitest-bonus-assertions/issues
|
|
120
|
+
[minitest]: https://github.com/seattlerb/minitest
|
|
121
|
+
[standardrb]: https://github.com/standardrb/standard
|
|
122
|
+
[tpope-qcm]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
|
123
|
+
[trailers1]: https://git-scm.com/docs/git-interpret-trailers
|
|
124
|
+
[trailers2]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---trailerlttokengtltvaluegt
|
data/CONTRIBUTORS.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Contributors
|
|
2
|
+
|
|
3
|
+
- Ben Somers ([@bensomers][@bensomers]) created minitest-extra-assertions
|
|
4
|
+
- Austin Ziegler forked it as minitest-bonus-assertions.
|
|
5
|
+
- Justin George ([@jaggederest][@jaggederest]) added `assert_between`.
|
|
6
|
+
- Josef Šimánek ([@simi][@simi]) fixed an improper self-dependency.
|
|
7
|
+
|
|
8
|
+
[@bensomers]: https://github.com/bensomers
|
|
9
|
+
[@jaggederest]: https://github.com/jaggederest
|
|
10
|
+
[@simi]: https://github.com/simi
|
data/LICENCE.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Licence
|
|
2
|
+
|
|
3
|
+
- SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
- Copyright 2015–2026 Austin Ziegler
|
|
6
|
+
- Copyright 2012 Ben Somers
|
|
7
|
+
|
|
8
|
+
The software in this repository is made available under the [MIT][mit] license.
|
|
9
|
+
|
|
10
|
+
## MIT License
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
13
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
14
|
+
the Software without restriction, including without limitation the rights to
|
|
15
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
16
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
+
subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
- The names of its contributors may not be used to endorse or promote products
|
|
20
|
+
derived from this software without specific prior written permission.
|
|
21
|
+
|
|
22
|
+
The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
copies or substantial portions of the Software.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
27
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
28
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
29
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
30
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
|
|
32
|
+
## Developer Certificate of Origin
|
|
33
|
+
|
|
34
|
+
All contributors **must** certify they are willing and able to provide their
|
|
35
|
+
contributions under the terms of this project's licences with the certification
|
|
36
|
+
of the [Developer Certificate of Origin (Version 1.1)](licences/dco.txt).
|
|
37
|
+
|
|
38
|
+
Such certification is provided by ensuring that a `Signed-off-by`
|
|
39
|
+
[commit trailer][trailer] is present on every commit:
|
|
40
|
+
|
|
41
|
+
Signed-off-by: FirstName LastName <email@example.org>
|
|
42
|
+
|
|
43
|
+
The `Signed-off-by` trailer can be automatically added by git with the `-s` or
|
|
44
|
+
`--signoff` option on `git commit`:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
git commit --signoff
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
[mit]: https://spdx.org/licenses/MIT.html
|
|
51
|
+
[trailer]: https://git-scm.com/docs/git-interpret-trailers
|
data/Manifest.txt
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
.
|
|
2
|
-
.
|
|
3
|
-
.
|
|
4
|
-
.
|
|
5
|
-
.
|
|
6
|
-
.workenv
|
|
7
|
-
Code-of-Conduct.rdoc
|
|
8
|
-
Contributing.rdoc
|
|
9
|
-
Gemfile
|
|
10
|
-
History.rdoc
|
|
11
|
-
Licence.rdoc
|
|
1
|
+
CHANGELOG.md
|
|
2
|
+
CODE_OF_CONDUCT.md
|
|
3
|
+
CONTRIBUTING.md
|
|
4
|
+
CONTRIBUTORS.md
|
|
5
|
+
LICENCE.md
|
|
12
6
|
Manifest.txt
|
|
13
|
-
README.
|
|
7
|
+
README.md
|
|
14
8
|
Rakefile
|
|
9
|
+
SECURITY.md
|
|
15
10
|
lib/minitest-bonus-assertions.rb
|
|
16
11
|
lib/minitest/assertion_tests.rb
|
|
12
|
+
lib/minitest/bonus_assertions.rb
|
|
13
|
+
lib/minitest/bonus_assertions/version.rb
|
|
14
|
+
licences/dco.txt
|
|
17
15
|
test/minitest_config.rb
|
|
18
16
|
test/test_minitest-bonus-assertions.rb
|
data/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# `minitest-bonus-assertions`
|
|
2
|
+
|
|
3
|
+
[![RubyGems Version][shield-gems]][rubygems] ![Coveralls][shield-coveralls]
|
|
4
|
+
[![Build Status][shield-ci]][ci-workflow]
|
|
5
|
+
|
|
6
|
+
- code :: <https://github.com/halostatue/minitest-bonus-assertions>
|
|
7
|
+
- issues :: <https://github.com/halostatue/minitest-bonus-assertions/issues>
|
|
8
|
+
- changelog ::
|
|
9
|
+
<https://github.com/halostatue/minitest-bonus-assertions/blob/main/CHANGELOG.md>
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
Bonus assertions for [Minitest][minitest], providing assertions I (used to) use
|
|
14
|
+
frequently, supporting only Ruby 2.0 or better.
|
|
15
|
+
|
|
16
|
+
> I have not used these regularly for tests in about ten years. They're still
|
|
17
|
+
> likely good, but I no longer consider them necessary.
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
New assertions:
|
|
22
|
+
|
|
23
|
+
- `assert_false` / `must_be_false`: requires that the value be exactly `false`.
|
|
24
|
+
- `assert_true` / `must_be_true`: requires that the value be exactly `true`.
|
|
25
|
+
- `assert_between` / `must_be_between`: requires that the value be strictly
|
|
26
|
+
between the low and high values provided, or the range (this test is
|
|
27
|
+
boundary-exclusive).
|
|
28
|
+
- `assert_has_keys` / `refute_missing_keys` / `must_have_keys`: requires that
|
|
29
|
+
the object contains all of the keys expected.
|
|
30
|
+
- `assert_missing_keys` / `refute_has_keys` / `must_not_have_keys`: requires
|
|
31
|
+
that the object _not_ have any of the keys expected.
|
|
32
|
+
- `assert_raises_with_message` / `must_raise_with_message`: requires that the
|
|
33
|
+
exception raised in the provided block has a specific message (tested with
|
|
34
|
+
`assert_equal`).
|
|
35
|
+
- `assert_set_equal` / `must_equal_set`: requires that the actual enumerable
|
|
36
|
+
have the same values as the expected enumerable, without regard to order and
|
|
37
|
+
ignoring duplicate values.
|
|
38
|
+
- `refute_set_equal` / `must_not_equal_set`: requires that the actual enumerable
|
|
39
|
+
_not_ have the same values as the expected enumerable.
|
|
40
|
+
- `assert_result_equal`: requires that the actual is equal to the result of
|
|
41
|
+
evaluating an expression.
|
|
42
|
+
|
|
43
|
+
I am also providing the Minitest-tester code I use as something that can be
|
|
44
|
+
required by other developers. This should _only_ be used to test Minitest
|
|
45
|
+
assertions and extensions. For more information on `Minitest::AssertionTests`,
|
|
46
|
+
see its documentation.
|
|
47
|
+
|
|
48
|
+
## Background
|
|
49
|
+
|
|
50
|
+
`minitest-bonus-assertions` started life as a patch to Ben Somer’s
|
|
51
|
+
[`minitest-extra-assertions`][extra]. There were some nice assertions included,
|
|
52
|
+
but there were other changes that needed to be made to bring it up to support
|
|
53
|
+
Minitest 5. There was also an override to the default `assert_match`
|
|
54
|
+
implementation meant to ease the transition from Test::Unit (the main reason he
|
|
55
|
+
wrote this assertion plugin for Minitest in the first place). I do not believe
|
|
56
|
+
this is sensible five major versions into Minitest: I removed it. Ben did not
|
|
57
|
+
feel comfortable making this particular change, so I felt that the best way to
|
|
58
|
+
provide the original assertions and my new assertions—without the `assert_match`
|
|
59
|
+
override—was to fork this as a new project. I am indebted to Ben and his
|
|
60
|
+
contributors for writing these assertions in the first place.
|
|
61
|
+
|
|
62
|
+
## `minitest-bonus-assertions` Semantic Versioning
|
|
63
|
+
|
|
64
|
+
`minitest-bonus-assertions` uses a [Semantic Versioning][semver] scheme with one
|
|
65
|
+
change:
|
|
66
|
+
|
|
67
|
+
- When PATCH is zero (`0`), it will be omitted from version references.
|
|
68
|
+
|
|
69
|
+
[ci-workflow]: https://github.com/halostatue/minitest-bonus-assertions/actions/workflows/ci.yml
|
|
70
|
+
[coveralls]: https://coveralls.io/github/halostatue/minitest-bonus-assertions?branch=main
|
|
71
|
+
[extra]: https://github.com/bensomers/minitest-extra-assertions
|
|
72
|
+
[minitest]: https://github.com/seattlerb/minitest
|
|
73
|
+
[rubygems]: https://rubygems.org/gems/minitest-bonus-assertions
|
|
74
|
+
[semver]: https://semver.org/
|
|
75
|
+
[shield-ci]: https://img.shields.io/github/actions/workflow/status/halostatue/minitest-bonus-assertions/ci.yml?style=for-the-badge "Build Status"
|
|
76
|
+
[shield-coveralls]: https://img.shields.io/coverallsCoverage/github/halostatue/minitest-bonus-assertions?style=for-the-badge
|
|
77
|
+
[shield-gems]: https://img.shields.io/gem/v/minitest-bonus-assertions?style=for-the-badge "Version"
|
data/Rakefile
CHANGED
|
@@ -1,74 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
3
|
+
require "rubygems"
|
|
4
|
+
require "hoe"
|
|
5
|
+
require "rake/clean"
|
|
6
|
+
require "rdoc/task"
|
|
7
|
+
require "minitest"
|
|
8
|
+
require "minitest/test_task"
|
|
6
9
|
|
|
7
|
-
Hoe.plugin :
|
|
8
|
-
Hoe.plugin :gemspec2
|
|
9
|
-
Hoe.plugin :git
|
|
10
|
-
Hoe.plugin :minitest
|
|
11
|
-
Hoe.plugin :travis
|
|
12
|
-
Hoe.plugin :email unless ENV['CI'] or ENV['TRAVIS']
|
|
10
|
+
Hoe.plugin :halostatue
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
Hoe.plugins.delete :debug
|
|
13
|
+
Hoe.plugins.delete :newb
|
|
14
|
+
Hoe.plugins.delete :publish
|
|
15
|
+
Hoe.plugins.delete :signing
|
|
16
|
+
Hoe.plugins.delete :test
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
hoe = Hoe.spec "minitest-bonus-assertions" do
|
|
19
|
+
developer("Austin Ziegler", "halostatue@gmail.com")
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
self.trusted_release = ENV["rubygems_release_gem"] == "true"
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
self.readme_file = 'README.rdoc'
|
|
23
|
-
self.extra_rdoc_files = FileList["*.rdoc"].to_a -
|
|
24
|
-
%w(History.rdoc README.rdoc)
|
|
23
|
+
require_ruby_version ">= 2.0"
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
extra_dev_deps << [
|
|
33
|
-
extra_dev_deps << [
|
|
34
|
-
extra_dev_deps << [
|
|
35
|
-
extra_dev_deps << [
|
|
36
|
-
extra_dev_deps << [
|
|
37
|
-
extra_dev_deps << [
|
|
38
|
-
extra_dev_deps << [
|
|
39
|
-
extra_dev_deps << [
|
|
40
|
-
extra_dev_deps << [
|
|
25
|
+
license "MIT"
|
|
26
|
+
|
|
27
|
+
spec_extras[:metadata] = ->(val) {
|
|
28
|
+
val["rubygems_mfa_required"] = "true"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
extra_dev_deps << ["hoe", "~> 4.0"]
|
|
32
|
+
extra_dev_deps << ["hoe-halostatue", "~> 2.1", ">= 2.1.1"]
|
|
33
|
+
extra_dev_deps << ["minitest", ">= 5.16", "< 7"]
|
|
34
|
+
extra_dev_deps << ["minitest-focus", "~> 1.1"]
|
|
35
|
+
extra_dev_deps << ["rake", ">= 10.0", "< 14"]
|
|
36
|
+
extra_dev_deps << ["rdoc", ">= 0.0", "< 7"]
|
|
37
|
+
extra_dev_deps << ["simplecov", "~> 0.22"]
|
|
38
|
+
extra_dev_deps << ["simplecov-lcov", "~> 0.8"]
|
|
39
|
+
extra_dev_deps << ["standard", "~> 1.0"]
|
|
41
40
|
end
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Rake::Task['test'].execute
|
|
56
|
-
end
|
|
42
|
+
Minitest::TestTask.create :test
|
|
43
|
+
Minitest::TestTask.create :coverage do |t|
|
|
44
|
+
formatters = <<-RUBY.split($/).join(" ")
|
|
45
|
+
SimpleCov::Formatter::MultiFormatter.new([
|
|
46
|
+
SimpleCov::Formatter::HTMLFormatter,
|
|
47
|
+
SimpleCov::Formatter::LcovFormatter,
|
|
48
|
+
SimpleCov::Formatter::SimpleFormatter
|
|
49
|
+
])
|
|
50
|
+
RUBY
|
|
51
|
+
t.test_prelude = <<-RUBY.split($/).join("; ")
|
|
52
|
+
require "simplecov"
|
|
53
|
+
require "simplecov-lcov"
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
SimpleCov::Formatter::LcovFormatter.config do |config|
|
|
56
|
+
config.report_with_single_file = true
|
|
57
|
+
config.lcov_file_name = "lcov.info"
|
|
59
58
|
end
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'SimpleCov.start("test_frameworks") { command_name "Minitest" }',
|
|
66
|
-
'gem "minitest"'
|
|
67
|
-
].join('; ')
|
|
68
|
-
Rake::Task['test'].execute
|
|
60
|
+
SimpleCov.start "test_frameworks" do
|
|
61
|
+
enable_coverage :branch
|
|
62
|
+
primary_coverage :branch
|
|
63
|
+
formatter #{formatters}
|
|
69
64
|
end
|
|
65
|
+
RUBY
|
|
66
|
+
end
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
task default: :test
|
|
69
|
+
|
|
70
|
+
task :version do
|
|
71
|
+
require "minitest/bonus_assertions/version"
|
|
72
|
+
puts Minitest::BonusAssertions::VERSION
|
|
72
73
|
end
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
RDoc::Task.new do
|
|
76
|
+
_1.title = "Bonus Assertions for Minitest"
|
|
77
|
+
_1.main = "lib/minitest/bonus_assertions.rb"
|
|
78
|
+
_1.rdoc_dir = "doc"
|
|
79
|
+
_1.rdoc_files = hoe.spec.require_paths - ["Manifest.txt"] + hoe.spec.extra_rdoc_files
|
|
80
|
+
_1.markup = "markdown"
|
|
81
|
+
end
|
|
82
|
+
task docs: :rerdoc
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# color Security Policy
|
|
2
|
+
|
|
3
|
+
## LLM-Generated Security Report Policy
|
|
4
|
+
|
|
5
|
+
Absolutely no security reports will be accepted that have been generated by LLM
|
|
6
|
+
agents.
|
|
7
|
+
|
|
8
|
+
## Supported Versions
|
|
9
|
+
|
|
10
|
+
Security reports are accepted for the most recent major release and the previous
|
|
11
|
+
version for a limited time after the initial major release version.
|
|
12
|
+
|
|
13
|
+
After a major release, the previous version will receive full support for three
|
|
14
|
+
months and security support for an additional three months (for a total of six
|
|
15
|
+
months).
|
|
16
|
+
|
|
17
|
+
Because color 1.x supports a wide range of Ruby versions that are themselves end
|
|
18
|
+
of life, security reports will only be accepted when they can be demonstrated on
|
|
19
|
+
Ruby 3.2 or higher.
|
|
20
|
+
|
|
21
|
+
> | Version | Release Date | Support Ends | Security Support Ends |
|
|
22
|
+
> | ------- | ------------ | ------------ | --------------------- |
|
|
23
|
+
> | 1.x | 2015-10-26 | 2025-11-07 | 2026-02-07 |
|
|
24
|
+
> | 2.x | 2025-08-07 | - | - |
|
|
25
|
+
|
|
26
|
+
## Reporting a Vulnerability
|
|
27
|
+
|
|
28
|
+
Create a [private vulnerability report][advisory] with GitHub.
|
|
29
|
+
|
|
30
|
+
[advisory]: https://github.com/halostatue/minitest-bonus-assertions/security/advisories/new
|
|
@@ -27,8 +27,8 @@ module Minitest::AssertionTests
|
|
|
27
27
|
|
|
28
28
|
Minitest::Test.reset
|
|
29
29
|
|
|
30
|
-
@tc = Minitest::Test.new
|
|
31
|
-
@spec = Minitest::Spec.new
|
|
30
|
+
@tc = Minitest::Test.new "fake test case"
|
|
31
|
+
@spec = Minitest::Spec.new "fake test spec"
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Specify the number of assertions that should be called during the test
|
|
@@ -37,7 +37,7 @@ module Minitest::AssertionTests
|
|
|
37
37
|
yield
|
|
38
38
|
ensure
|
|
39
39
|
actual = tc.assertions + spec.assertions
|
|
40
|
-
assert_equal expected, actual, "expected #{expected} assertions to be "
|
|
40
|
+
assert_equal expected, actual, "expected #{expected} assertions to be " \
|
|
41
41
|
"fired during the test, not #{actual}"
|
|
42
42
|
end
|
|
43
43
|
|
|
@@ -48,7 +48,7 @@ module Minitest::AssertionTests
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
msg = e.message.sub(/(---Backtrace---).*/m, '\1')
|
|
51
|
-
msg.gsub!(/\(oid=[-0-9]+\)/,
|
|
51
|
+
msg.gsub!(/\(oid=[-0-9]+\)/, "(oid=N)")
|
|
52
52
|
msg.gsub!(/(\d\.\d{6})\d+/, '\1xxx') # normalize: ruby version, impl, platform
|
|
53
53
|
|
|
54
54
|
assert_equal expected, msg
|