pundit-matchers 1.9.0 → 2.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.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f3b354daf4a7619dc0fe63bc65984f0a8390b5fc9a3a2b1c7d2129cb5d12bf0
|
4
|
+
data.tar.gz: c4a47b2387ddcf8541c7fe8f7e7b98067263d312db6a9d3718621d5fb446b115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adac619cd1badd3d0f83ccb535a45f4633f199badb12c6daba7d4b9a2be5f79db321f6268645b6a66d6776f4b048fb2096cb3dd74c850be64a9caf56d3d9bce2
|
7
|
+
data.tar.gz: 25fb9deee8b3779156ea4d6ba26b71a5af47133bd2d4fdb594fe119e2803d85265027c7c8044a2c2ce364d04f5933330e752857617a4fd598c3596f1c2d8e2b2
|
data/lib/pundit/matchers.rb
CHANGED
@@ -26,12 +26,12 @@ module Pundit
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
RSpec::Matchers.define :forbid_action do |action, *args|
|
29
|
+
RSpec::Matchers.define :forbid_action do |action, *args, **kwargs|
|
30
30
|
match do |policy|
|
31
31
|
if args.any?
|
32
|
-
!policy.public_send("#{action}?", *args)
|
32
|
+
!policy.public_send("#{action}?", *args, **kwargs)
|
33
33
|
else
|
34
|
-
!policy.public_send("#{action}?")
|
34
|
+
!policy.public_send("#{action}?", **kwargs)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -189,12 +189,12 @@ module Pundit
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
-
RSpec::Matchers.define :permit_action do |action, *args|
|
192
|
+
RSpec::Matchers.define :permit_action do |action, *args, **kwargs|
|
193
193
|
match do |policy|
|
194
194
|
if args.any?
|
195
|
-
policy.public_send("#{action}?", *args)
|
195
|
+
policy.public_send("#{action}?", *args, **kwargs)
|
196
196
|
else
|
197
|
-
policy.public_send("#{action}?")
|
197
|
+
policy.public_send("#{action}?", **kwargs)
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|