rspec-description_consistency 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddd806c67283809955e71203d7d6990c82425076b46fdb17792a2a36a5aeb025
4
- data.tar.gz: bfdf469f31d3b0975fe7d222ac71c166ebb012931a7b9bcfe8dcfbd5826c91c9
3
+ metadata.gz: 6d1d13615481394e4fd66245932bd731f9c698ece8d9a31fc74295ed9c602d87
4
+ data.tar.gz: d4ff2f6dda1b6883e7c0f5053d8d1cd4c1da859c328d9df8a261d25c0355f121
5
5
  SHA512:
6
- metadata.gz: 7d495fdd45eaa7577d85bcff0c63c8cff8d30f4929976fe5c573c500643700ad592475be6973c5c6cba97c7749dda6d99c7328a83fdeb7ec127b111deaf263a3
7
- data.tar.gz: ae235e216f260506492e481a60d6f0fd76462b3c17c72cd245d8c3a047f196ae2898487c7e870f71bb600457c4f2c8c9c85624dc8f3a5184b896cc2158e0361d
6
+ metadata.gz: ba7b906c6213f3ad9eb2b924a71746cf8c6e8b1fb50c004d0b609a6ed125a23cec6704ea0516a77104c10ba92ca513e593538e74280b26608f8044515c740acf
7
+ data.tar.gz: ce059363eaacd1600b35bc8fd92e6f7ae539f0cc2200a9efe51ec802c986b80829f58c888ce56f3700b8d5d7e28c017583ad28d0b8e28bc18b68982841648d66
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.3] - 2024-07-04
4
+
5
+ - Fix invalid private method verification [(#3)](https://github.com/viralpraxis/rspec-description_consistency/pull/3)
6
+
7
+ ## [1.0.2] - 2024-07-04
8
+
9
+ - Add support for `ActiveRecord` attributes [(#2)](https://github.com/viralpraxis/rspec-description_consistency/pull/2)
10
+
3
11
  ## [1.0.1] - 2024-07-04
4
12
 
5
13
  - Fix incorrect instance method check in case of dynamically defined methods [(#1)](https://github.com/viralpraxis/rspec-description_consistency/pull/1)
@@ -43,10 +43,12 @@ 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?('#') && include_private
47
- klass.instance_methods.include?(method_name) || klass.private_instance_methods.include?(method_name)
48
- elsif description.start_with?('#')
49
- klass.instance_methods.include?(method_name)
46
+ if description.start_with?('#')
47
+ return true if klass.instance_methods.include?(method_name)
48
+ return false unless include_private
49
+ return true if klass.private_instance_methods.include?(method_name)
50
+
51
+ klass.respond_to?(:attribute_names) && klass.attribute_names.include?(method_name.to_s)
50
52
  elsif description.start_with?('.')
51
53
  correct_class_method?(method_name, klass, include_private: include_private)
52
54
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rspec
4
4
  module DescriptionConsistency
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-description_consistency
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
  - Iaroslav Kurbatov