pundit-matchers 3.1.1 → 4.0.0

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: 141abfa7ebc01c34b65ed5231dd3b66d7453d49a0797f2d8f8cf3c79058f4e4c
4
- data.tar.gz: bd9508d4a9f95d60e4239ab0f96a9f210ca8137c907f846ecefcc35a062fcfae
3
+ metadata.gz: 036d5ac0d690ecb8d0326ba5760d48479a66bc22ed1571463b9873c7fff08377
4
+ data.tar.gz: ed218146650c6603efbc5f63e58dd7b07a9aa57b0c2012597f1b17f194d4349e
5
5
  SHA512:
6
- metadata.gz: 7f9c778c08f01c7ffe3060480d55570d18c37358db1c87016bf66608028690764b8a4ac53419ef162fcce71b345dd05c8a617aa1f0598cbeb6d554033b0c1c0a
7
- data.tar.gz: f68b63d3155d1fd806c3dd061e5e330fcf656a14bf51ada7d25d856e161b5324822913114328e01d5bd76c99d2198e69a415fdfb21137793bab6ec5815ec741a
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 = +"expected '#{policy_info}' to forbid all actions,"
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 = +"expected '#{policy_info}' to forbid only #{expected_actions},"
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 = +"expected '#{policy_info}' to permit #{expected_actions},"
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 = +"expected '#{policy_info}' to forbid #{expected_actions},"
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 = +"expected '#{policy_info}' to permit all actions,"
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 = +"expected '#{policy_info}' to permit the mass assignment of #{expected_attributes}"
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 = +"expected '#{policy_info}' to forbid the mass assignment of #{expected_attributes}"
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 = +"expected '#{policy_info}' to permit only #{expected_actions},"
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: 3.1.1
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: 2023-06-25 00:00:00.000000000 Z
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/punditcommunity/pundit-matchers
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.0'
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.4.12
106
+ rubygems_version: 3.5.22
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: RSpec matchers for Pundit policies