rspec-description_consistency 1.0.0 → 1.0.1
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/CHANGELOG.md +5 -1
- data/README.md +2 -4
- data/lib/rspec/description_consistency/consitency_verifier.rb +4 -4
- data/lib/rspec/description_consistency/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddd806c67283809955e71203d7d6990c82425076b46fdb17792a2a36a5aeb025
|
4
|
+
data.tar.gz: bfdf469f31d3b0975fe7d222ac71c166ebb012931a7b9bcfe8dcfbd5826c91c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d495fdd45eaa7577d85bcff0c63c8cff8d30f4929976fe5c573c500643700ad592475be6973c5c6cba97c7749dda6d99c7328a83fdeb7ec127b111deaf263a3
|
7
|
+
data.tar.gz: ae235e216f260506492e481a60d6f0fd76462b3c17c72cd245d8c3a047f196ae2898487c7e870f71bb600457c4f2c8c9c85624dc8f3a5184b896cc2158e0361d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [0.1
|
3
|
+
## [1.0.1] - 2024-07-04
|
4
|
+
|
5
|
+
- Fix incorrect instance method check in case of dynamically defined methods [(#1)](https://github.com/viralpraxis/rspec-description_consistency/pull/1)
|
6
|
+
|
7
|
+
## [1.0.0] - 2024-07-03
|
4
8
|
|
5
9
|
- Initial release
|
data/README.md
CHANGED
@@ -35,15 +35,13 @@ This gem enforces consistency by checking descriptions against the described obj
|
|
35
35
|
|
36
36
|
## Installation
|
37
37
|
|
38
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
39
|
-
|
40
38
|
Install the gem and add to the application's Gemfile by executing:
|
41
39
|
|
42
|
-
$ bundle add
|
40
|
+
$ bundle add rspec-description_consistency
|
43
41
|
|
44
42
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
45
43
|
|
46
|
-
$ gem install
|
44
|
+
$ gem install rspec-description_consistency
|
47
45
|
|
48
46
|
## Usage
|
49
47
|
|
@@ -44,23 +44,23 @@ module RSpec
|
|
44
44
|
method_name = description[1..].to_sym
|
45
45
|
|
46
46
|
if description.start_with?('#') && include_private
|
47
|
-
klass.
|
47
|
+
klass.instance_methods.include?(method_name) || klass.private_instance_methods.include?(method_name)
|
48
48
|
elsif description.start_with?('#')
|
49
|
-
klass.
|
49
|
+
klass.instance_methods.include?(method_name)
|
50
50
|
elsif description.start_with?('.')
|
51
51
|
correct_class_method?(method_name, klass, include_private: include_private)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
55
|
def correct_class_method?(method_name, klass, include_private:)
|
56
|
-
klass.singleton_class.
|
56
|
+
klass.singleton_class.instance_methods.include?(method_name) ||
|
57
57
|
(include_private && klass.singleton_class.private_instance_methods.include?(method_name)) ||
|
58
58
|
activesupport_concern?(method_name, klass)
|
59
59
|
end
|
60
60
|
|
61
61
|
def activesupport_concern?(method_name, klass)
|
62
62
|
if klass.is_a?(Module) && klass.const_defined?(:ClassMethods) &&
|
63
|
-
klass.const_get(:ClassMethods).
|
63
|
+
klass.const_get(:ClassMethods).instance_methods.include?(method_name)
|
64
64
|
true
|
65
65
|
else
|
66
66
|
Object.const_defined?(:ActiveSupport) && ::ActiveSupport.const_defined?(:Concern) &&
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-description_consistency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iaroslav Kurbatov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Automatic checking of consistency of descriptions in context and describe
|
14
14
|
blocks, and class or module methods.
|