mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
RSpec 3 Compatability
Figure out how to access the current example. Leaving in deprecated match and message methods for now.
This commit is contained in:
parent
78750e6dcc
commit
998971798c
1 changed files with 2 additions and 1 deletions
|
@ -21,7 +21,8 @@ module Pundit
|
|||
end
|
||||
|
||||
def permissions
|
||||
example.metadata[:permissions]
|
||||
current_example = ::RSpec.respond_to?(:current_example) ? ::RSpec.current_example : example
|
||||
current_example.metadata[:permissions]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue