rspec-description_consistency 1.0.1 → 1.0.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea1200d9bb0432aaf51947c5dc92b50a9c1709171b38e50beb9a583d5c8915c6
|
4
|
+
data.tar.gz: 65995762b57410b053e3353dfbf11a36b933a907945fc5de17bfe0ddab6cb441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20a9c5e7cb54039ad537f3275a7a75655ff49ccc507cbdfa3a34754186aafe4ae97e07a906302c3986aa5c65a2f8078322269f57d59fdacdbe509d6410801682
|
7
|
+
data.tar.gz: 31a0a471494a0a0cc33f881661b07271fb4fa386379744e66c8ec4b8337f17d890c47954f84a61776df4efee7b21df4946f19cb138b63ce451a05666e15e5bcf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.0.2] - 2024-07-04
|
4
|
+
|
5
|
+
- Add support for `ActiveRecord` attributes [(#2)](https://github.com/viralpraxis/rspec-description_consistency/pull/2)
|
6
|
+
|
3
7
|
## [1.0.1] - 2024-07-04
|
4
8
|
|
5
9
|
- Fix incorrect instance method check in case of dynamically defined methods [(#1)](https://github.com/viralpraxis/rspec-description_consistency/pull/1)
|
@@ -43,10 +43,11 @@ module RSpec
|
|
43
43
|
def correct_method_example_group?(description, klass, include_private:)
|
44
44
|
method_name = description[1..].to_sym
|
45
45
|
|
46
|
-
if description.start_with?('#')
|
47
|
-
klass.instance_methods.include?(method_name) || klass.private_instance_methods.include?(method_name)
|
48
|
-
elsif description.start_with?('#')
|
46
|
+
if description.start_with?('#')
|
49
47
|
klass.instance_methods.include?(method_name)
|
48
|
+
elsif description.start_with?('#') && include_private
|
49
|
+
klass.private_instance_methods.include?(method_name) ||
|
50
|
+
(klass.respond_to?(:attribute_names) && klass.attribute_names.include?(method_name.to_s))
|
50
51
|
elsif description.start_with?('.')
|
51
52
|
correct_class_method?(method_name, klass, include_private: include_private)
|
52
53
|
end
|