Class: Proc
Instance Method Summary collapse
Instance Method Details
#change? ⇒ Boolean
19 20 21 22 23 24 |
# File 'lib/motion-spec/extensions/proc.rb', line 19 def change? pre_result = yield call post_result = yield pre_result != post_result end |
#raise?(*exceptions) ⇒ Boolean
3 4 5 6 7 8 9 |
# File 'lib/motion-spec/extensions/proc.rb', line 3 def raise?(*exceptions) call rescue *(exceptions.empty? ? RuntimeError : exceptions) => e e else false end |
#throw?(sym) ⇒ Boolean
11 12 13 14 15 16 17 |
# File 'lib/motion-spec/extensions/proc.rb', line 11 def throw?(sym) catch(sym) do call return false end true end |