enumerations 2.5.1 → 2.5.2
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/.github/workflows/test.yml +2 -2
- data/CHANGELOG.md +17 -1
- data/lib/enumerations/base.rb +1 -1
- data/lib/enumerations/version.rb +1 -1
- data/test/enumerations_test.rb +6 -0
- data/test/helpers/test_helper.rb +2 -0
- data/test/value_test.rb +18 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34bf65bbe1b914b7d56e3b2ef93b0379deccc09709e37900ea4d6ed8ea97fa3d
|
4
|
+
data.tar.gz: da852c0b54ab6c0013564f2b30b0d6df7ccdb1ddd6017c551d078994874f3691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee7e94705e02796314e0f494d6c55231173b76697d34c691e38bc511f7448216306af75fa016558247903210b965a19316fa358210dd83c00ea42e589f05d211
|
7
|
+
data.tar.gz: 485c5e53c7dd4b3b5a85c5725f321354e822907fddb64f76c14abeed130c084cd11ea77469376519e08897e594d75b3a5445b7fcc9c7f10c64160f1af344b8df
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [v2.5.
|
3
|
+
## [v2.5.2](https://github.com/infinum/enumerations/tree/v2.5.2) (2022-01-27)
|
4
|
+
[Full Changelog](https://github.com/infinum/enumerations/compare/v2.5.1...v2.5.2)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- Adds Ruby 3.1 to test suite. Changes the runner to ubuntu-latest.
|
9
|
+
|
10
|
+
**Closed issues:**
|
11
|
+
|
12
|
+
- Ruby 3.0, `respond_to? :name` always returns true [\#55](https://github.com/infinum/enumerations/issues/55)
|
13
|
+
|
14
|
+
**Merged pull requests:**
|
15
|
+
|
16
|
+
- Initialize `ActiveSupport::Multibyte::Chars` with a String [\#56](https://github.com/infinum/enumerations/pull/56) ([lovro-bikic](https://github.com/lovro-bikic))
|
17
|
+
- Test against Ruby 3.1 [\#57](https://github.com/infinum/enumerations/pull/57) ([lovro-bikic](https://github.com/lovro-bikic))
|
18
|
+
|
19
|
+
## [v2.5.1](https://github.com/infinum/enumerations/tree/v2.5.1) (2021-05-24)
|
4
20
|
[Full Changelog](https://github.com/infinum/enumerations/compare/v2.5.0...v2.5.1)
|
5
21
|
|
6
22
|
**Implemented enhancements:**
|
data/lib/enumerations/base.rb
CHANGED
data/lib/enumerations/version.rb
CHANGED
data/test/enumerations_test.rb
CHANGED
@@ -26,6 +26,12 @@ class EnumerationsTest < Minitest::Test
|
|
26
26
|
assert_equal 'draft', p.status.to_s
|
27
27
|
end
|
28
28
|
|
29
|
+
def test_model_uniqueness_validation
|
30
|
+
p = Post.new(status: :draft)
|
31
|
+
|
32
|
+
assert_equal true, p.valid?
|
33
|
+
end
|
34
|
+
|
29
35
|
def test_model_bang_assignment_with_custom_name
|
30
36
|
p = Post.new
|
31
37
|
p.different_status_draft!
|
data/test/helpers/test_helper.rb
CHANGED
data/test/value_test.rb
CHANGED
@@ -82,4 +82,22 @@ class ValueTest < Minitest::Test
|
|
82
82
|
|
83
83
|
assert_equal status.name?, false
|
84
84
|
end
|
85
|
+
|
86
|
+
def test_enumeration_raises_error_for_nonexistent_attribute
|
87
|
+
enum = Class.new(Enumerations::Base) do
|
88
|
+
value :foobar
|
89
|
+
end
|
90
|
+
|
91
|
+
assert_raises NoMethodError do
|
92
|
+
enum.foobar.name
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_enumeration_does_not_respond_to_nonexistent_attribute
|
97
|
+
enum = Class.new(Enumerations::Base) do
|
98
|
+
value :foobar
|
99
|
+
end
|
100
|
+
|
101
|
+
assert_equal enum.foobar.respond_to?(:name), false
|
102
|
+
end
|
85
103
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomislav Car
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
- Nikola Santić
|
10
10
|
- Stjepan Hadjić
|
11
11
|
- Petar Ćurković
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
date: 2017-09-08 00:00:00.000000000 Z
|
@@ -158,7 +158,7 @@ files:
|
|
158
158
|
homepage: https://github.com/infinum/enumerations
|
159
159
|
licenses: []
|
160
160
|
metadata: {}
|
161
|
-
post_install_message:
|
161
|
+
post_install_message:
|
162
162
|
rdoc_options: []
|
163
163
|
require_paths:
|
164
164
|
- lib
|
@@ -173,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
177
|
-
signing_key:
|
176
|
+
rubygems_version: 3.3.3
|
177
|
+
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Enumerations for ActiveRecord!
|
180
180
|
test_files: []
|