1
0
Fork 0
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:
pathouse 2014-03-13 15:19:43 -04:00
parent 78750e6dcc
commit 998971798c

View file

@ -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