rspec_model_validations 1.0.1 → 1.0.3

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: 6c7eddb001578c400fb07e353dc90519a5a9003e62856cadb4de221060ba97bf
4
- data.tar.gz: 0f7cdb19b649ea52717542a66614bff5a62f592000d7750df6c9103dfb611982
3
+ metadata.gz: f72e0cca20e520d22613403073e1b5ab8ba74bfb8d6538f1d019d40b006ed7fa
4
+ data.tar.gz: 49a56433ea4378a9c4a14825434442f88c03980daf82d9b1ccacebdff1ce0d5e
5
5
  SHA512:
6
- metadata.gz: 3325f11863d332b16dde60c6092dbeb19ca18b4ae7cfefbaf1b9fc6868816941c3310d8a0a2970a14680962454144207c05007d7521d558dd96228276a1e781e
7
- data.tar.gz: ebe6d58e97a337e6c2dd4436073312251b94b66307fd7d3ee5acb2576a8b7515d77b50fdf1bc7971799d068227013d43dbe4967d5fe7fe90db3f64b258e67484
6
+ metadata.gz: '09455c67b4b235d069d4b8e8673622c6357277a289dbf2d61567dab5c45f84160f17ae01645e840856e44fc3ac0753390b91b8701ed842bb63b04f2fd32e1ef3'
7
+ data.tar.gz: 6a1197468487d9bda07e83f438ced0cc0bb117687707cb98fd76c54ec548fb950b10aaadcebf5b5fe4b9f8b4b9f7bc7a1eb93494ce48709d6c9fe8503c82702e
@@ -34,7 +34,7 @@ module RspecModelValidations::Matchers::Base
34
34
  # @param model [ActiveModel::Model]
35
35
  # @return [Array]
36
36
  def attribute_errors model
37
- model.instance_variable_set "@#{@attribute}", @on if defined? @on
37
+ model.attributes = { @attribute => @on } if defined? @on
38
38
  model.validate
39
39
  model.errors.group_by_attribute[@attribute]&.map(&:type) || []
40
40
  end
@@ -43,7 +43,7 @@ module RspecModelValidations::Matchers::Base
43
43
  # Attribute must exist
44
44
  # @param model [ActiveModel::Model]
45
45
  # @return [Object]
46
- def attribute_value model; model.instance_variable_get "@#{@attribute}" end
46
+ def attribute_value model; model.send @attribute end
47
47
 
48
48
  # Format a matcher expected / got faillure message
49
49
  # @param expected [String] expected part of the message
@@ -3,5 +3,5 @@
3
3
  # Root module
4
4
  module RspecModelValidations
5
5
  # RspecModelValidations version number: major.minor.maintenance
6
- VERSION = '1.0.1'
6
+ VERSION = '1.0.3'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_model_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Guego
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-05 00:00:00.000000000 Z
11
+ date: 2022-11-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: