Skip to content

Commit a4b184a

Browse files
authored
Merge pull request #41 from fac/fix-minitest-deprecations-warnings-errors
Fix issue with missing require in later active_support releases
2 parents 6734384 + a4ee71d commit a4b184a

26 files changed

+135
-122
lines changed

.github/workflows/reviewdog.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
name: runner / actionlint
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v3
99
- name: actionlint
10-
uses: reviewdog/action-actionlint@v1.2.0
10+
uses: reviewdog/action-actionlint@v1
1111
with:
1212
fail_on_error: true
1313
reporter: github-pr-review

CHANGELOG.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
##[2.6.2] - 2022-01-10
10+
## [2.7.0] - 2022-05-25
11+
### Fixed
12+
- Added missing require in `Hermod::XmlSectionBuilder`
13+
- Fixed deprecations in Minitest
14+
15+
### Removed
16+
- Remove unused bad_attributes attr_reader on `Hermod::Validators::Attributes`
17+
18+
### Changed
19+
- Updated development dependencies
20+
21+
## [2.6.2] - 2022-01-10
22+
### Changed
1123
- Remove the upper limit on the activesupport version
1224

13-
##[2.6.1] - 2020-10-22
25+
## [2.6.1] - 2020-10-22
1426
## Added
1527
- Changelog updates
1628

17-
##[2.6.0] - 2020-10-22
29+
## [2.6.0] - 2020-10-22
1830
## Added
1931
- Update libxml-ruby to version ~> 3.2
2032
- Update ruby-version to 2.7.1
2133

22-
##[2.5.3] - 2019-11-01
34+
## [2.5.3] - 2019-11-01
2335
### Added
2436
- Link wiki to the readme file.
2537

hermod.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Gem::Specification.new do |spec|
2727

2828
spec.add_development_dependency "bundler", "~> 2.0"
2929
spec.add_development_dependency "rake", "13.0.1"
30-
spec.add_development_dependency "minitest", "~> 5.3"
31-
spec.add_development_dependency "minitest-reporters", "~> 1.0", ">= 1.0.16"
32-
spec.add_development_dependency "nokogiri", "~> 1.5"
30+
spec.add_development_dependency "minitest", "~> 5.15"
31+
spec.add_development_dependency "minitest-reporters", ">= 1.0.16", "~> 1.5"
32+
spec.add_development_dependency "nokogiri", "~> 1.13"
3333

3434
spec.metadata = {
3535
"allowed_push_host" => "https://rubygems.org",

lib/hermod/validators/attributes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Hermod
44
module Validators
55
# Checks the attributes are in a list of allowed attributes
66
class Attributes < Base
7-
attr_reader :allowed_attributes, :bad_attributes
7+
attr_reader :allowed_attributes
88

99
# Public: Sets up the list of allowed attributes
1010
def initialize(allowed_attributes)

lib/hermod/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Hermod
2-
VERSION = "2.6.2"
2+
VERSION = "2.7.0"
33
end

lib/hermod/xml_section_builder.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
require 'bigdecimal'
21
require 'active_support'
32
require 'active_support/core_ext/string/inflections'
43
require 'active_support/core_ext/object/blank'
4+
require 'bigdecimal'
5+
require 'date'
56

67
require 'hermod/xml_node'
78
require 'hermod/input_mutator'

spec/hermod/validators/allowed_values_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ module Validators
88
end
99

1010
it "permits values in the list" do
11-
subject.valid?("Cat", {}).must_equal true
11+
expect(subject.valid?("Cat", {})).must_equal true
1212
end
1313

1414
it "allows blank values" do
15-
subject.valid?("", {}).must_equal true
16-
subject.valid?(nil, {}).must_equal true
15+
expect(subject.valid?("", {})).must_equal true
16+
expect(subject.valid?(nil, {})).must_equal true
1717
end
1818

1919
it "raises an error for values not in the list" do
20-
ex = proc { subject.valid?("Albatross", {}) }.must_raise InvalidInputError
21-
ex.message.must_equal "must be one of Antelope, Bear, Cat, Dog, or Elephant, not Albatross"
20+
ex = expect { subject.valid?("Albatross", {}) }.must_raise InvalidInputError
21+
expect(ex.message).must_equal "must be one of Antelope, Bear, Cat, Dog, or Elephant, not Albatross"
2222
end
2323
end
2424
end

spec/hermod/validators/attributes_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ module Validators
88
end
99

1010
it "permits attributes in the list" do
11-
subject.valid?(nil, {species: "Felis catus", genus: "Felis"}).must_equal true
11+
expect(subject.valid?(nil, {species: "Felis catus", genus: "Felis"})).must_equal true
1212
end
1313

1414
it "raises an error for attributes not in the list" do
15-
ex = proc { subject.valid?(nil, {phylum: "Chordata"}) }.must_raise InvalidInputError
16-
ex.message.must_equal "has attributes it doesn't accept: phylum"
15+
ex = expect { subject.valid?(nil, {phylum: "Chordata"}) }.must_raise InvalidInputError
16+
expect(ex.message).must_equal "has attributes it doesn't accept: phylum"
1717
end
1818
end
1919
end

spec/hermod/validators/base_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Validators
88
end
99

1010
it "doesn't implement a test" do
11-
proc { subject.valid?(nil, {}) }.must_raise NotImplementedError
11+
expect { subject.valid?(nil, {}) }.must_raise NotImplementedError
1212
end
1313

1414
it "has a default error message" do
@@ -17,8 +17,8 @@ def test(value, attributes)
1717
false
1818
end
1919
end
20-
ex = proc { TestValidator.new.valid?(nil, {}) }.must_raise InvalidInputError
21-
ex.message.must_equal "is invalid"
20+
ex = expect { TestValidator.new.valid?(nil, {}) }.must_raise InvalidInputError
21+
expect(ex.message).must_equal "is invalid"
2222
end
2323
end
2424
end

spec/hermod/validators/non_negative_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ module Validators
88
end
99

1010
it "allows positive values" do
11-
subject.valid?(1, {}).must_equal true
11+
expect(subject.valid?(1, {})).must_equal true
1212
end
1313

1414
it "allows zero values" do
15-
subject.valid?(0, {}).must_equal true
15+
expect(subject.valid?(0, {})).must_equal true
1616
end
1717

1818
it "allows blank values" do
19-
subject.valid?(nil, {}).must_equal true
19+
expect(subject.valid?(nil, {})).must_equal true
2020
end
2121

2222
it "raises an error for negative values" do
23-
ex = proc { subject.valid?(-1, {}) }.must_raise InvalidInputError
24-
ex.message.must_equal "cannot be negative"
23+
ex = expect { subject.valid?(-1, {}) }.must_raise InvalidInputError
24+
expect(ex.message).must_equal "cannot be negative"
2525
end
2626
end
2727
end

0 commit comments

Comments
 (0)