pundit-matchers 3.1.1 → 4.0.0
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/lib/pundit/matchers/base_matcher.rb +1 -1
- data/lib/pundit/matchers/forbid_all_actions_matcher.rb +1 -1
- data/lib/pundit/matchers/forbid_only_actions_matcher.rb +1 -1
- data/lib/pundit/matchers/permit_actions_matcher.rb +2 -2
- data/lib/pundit/matchers/permit_all_actions_matcher.rb +1 -1
- data/lib/pundit/matchers/permit_attributes_matcher.rb +2 -2
- data/lib/pundit/matchers/permit_only_actions_matcher.rb +1 -1
- 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: 036d5ac0d690ecb8d0326ba5760d48479a66bc22ed1571463b9873c7fff08377
|
4
|
+
data.tar.gz: ed218146650c6603efbc5f63e58dd7b07a9aa57b0c2012597f1b17f194d4349e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2acfbcb28c1cca1b7a74bb83c440b9e35485371c42e56933b017eba4bfb373496ae282b55acbeaad12e47508efaf9cff420645bfc4fcd1499349460f63225342
|
7
|
+
data.tar.gz: bd8c0544919cfc0ffad981a35ada355cf5937de17e8f68bb8a280039d3bb9fd1c770abf834490a02122292c30de6a2b5df62604e12acf49c86bfb80f427309df
|
@@ -6,7 +6,7 @@ module Pundit
|
|
6
6
|
module Matchers
|
7
7
|
# This is the base class for all matchers in the Pundit Matchers library.
|
8
8
|
class BaseMatcher
|
9
|
-
include RSpec::Matchers::Composable
|
9
|
+
include ::RSpec::Matchers::Composable
|
10
10
|
|
11
11
|
# Error message when an ambiguous negated matcher is used.
|
12
12
|
AMBIGUOUS_NEGATED_MATCHER_ERROR = <<~MSG
|
@@ -34,7 +34,7 @@ module Pundit
|
|
34
34
|
#
|
35
35
|
# @return [String] Failure message.
|
36
36
|
def failure_message
|
37
|
-
message =
|
37
|
+
message = "expected '#{policy_info}' to forbid all actions,"
|
38
38
|
message << " but permitted #{policy_info.permitted_actions}"
|
39
39
|
message << user_message
|
40
40
|
end
|
@@ -38,7 +38,7 @@ module Pundit
|
|
38
38
|
#
|
39
39
|
# @return [String] A failure message when the expected actions and the forbidden actions do not match.
|
40
40
|
def failure_message
|
41
|
-
message =
|
41
|
+
message = "expected '#{policy_info}' to forbid only #{expected_actions},"
|
42
42
|
message << " but forbade #{actual_actions}" unless actual_actions.empty?
|
43
43
|
message << extra_message unless extra_actions.empty?
|
44
44
|
message << user_message
|
@@ -47,7 +47,7 @@ module Pundit
|
|
47
47
|
#
|
48
48
|
# @return [String] A failure message when the expected actions are not forbidden.
|
49
49
|
def failure_message
|
50
|
-
message =
|
50
|
+
message = "expected '#{policy_info}' to permit #{expected_actions},"
|
51
51
|
message << " but forbade #{actual_actions}"
|
52
52
|
message << user_message
|
53
53
|
end
|
@@ -56,7 +56,7 @@ module Pundit
|
|
56
56
|
#
|
57
57
|
# @return [String] A failure message when the expected actions are permitted.
|
58
58
|
def failure_message_when_negated
|
59
|
-
message =
|
59
|
+
message = "expected '#{policy_info}' to forbid #{expected_actions},"
|
60
60
|
message << " but permitted #{actual_actions}"
|
61
61
|
message << user_message
|
62
62
|
end
|
@@ -34,7 +34,7 @@ module Pundit
|
|
34
34
|
#
|
35
35
|
# @return [String] A failure message when the policy does not permit all actions.
|
36
36
|
def failure_message
|
37
|
-
message =
|
37
|
+
message = "expected '#{policy_info}' to permit all actions,"
|
38
38
|
message << " but forbade #{policy_info.forbidden_actions}"
|
39
39
|
message << user_message
|
40
40
|
end
|
@@ -41,7 +41,7 @@ module Pundit
|
|
41
41
|
#
|
42
42
|
# @return [String] A failure message when the expected attributes are not permitted.
|
43
43
|
def failure_message
|
44
|
-
message =
|
44
|
+
message = "expected '#{policy_info}' to permit the mass assignment of #{expected_attributes}"
|
45
45
|
message << action_message if options.key?(:action)
|
46
46
|
message << ", but forbade the mass assignment of #{actual_attributes}"
|
47
47
|
message << user_message
|
@@ -51,7 +51,7 @@ module Pundit
|
|
51
51
|
#
|
52
52
|
# @return [String] A failure message when the expected attributes are forbidden.
|
53
53
|
def failure_message_when_negated
|
54
|
-
message =
|
54
|
+
message = "expected '#{policy_info}' to forbid the mass assignment of #{expected_attributes}"
|
55
55
|
message << action_message if options.key?(:action)
|
56
56
|
message << ", but permitted the mass assignment of #{actual_attributes}"
|
57
57
|
message << user_message
|
@@ -38,7 +38,7 @@ module Pundit
|
|
38
38
|
#
|
39
39
|
# @return [String] A failure message when the expected actions and the permitted actions do not match.
|
40
40
|
def failure_message
|
41
|
-
message =
|
41
|
+
message = "expected '#{policy_info}' to permit only #{expected_actions},"
|
42
42
|
message << " but permitted #{actual_actions}" unless actual_actions.empty?
|
43
43
|
message << extra_message unless extra_actions.empty?
|
44
44
|
message << user_message
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pundit-matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Alley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-core
|
@@ -83,7 +83,7 @@ files:
|
|
83
83
|
- lib/pundit/matchers/permit_attributes_matcher.rb
|
84
84
|
- lib/pundit/matchers/permit_only_actions_matcher.rb
|
85
85
|
- lib/pundit/matchers/utils/policy_info.rb
|
86
|
-
homepage: https://github.com/
|
86
|
+
homepage: https://github.com/pundit-community/pundit-matchers
|
87
87
|
licenses:
|
88
88
|
- MIT
|
89
89
|
metadata:
|
@@ -96,14 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '3.
|
99
|
+
version: '3.1'
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.5.22
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: RSpec matchers for Pundit policies
|