Module: Assay::Bang::ProcMethods
- Included in:
- Proc
- Defined in:
- lib/assay/bang.rb
Overview
Included into Proc, for assertions about what calling it does.
Instance Method Summary collapse
- #not_raises!(*exceptions) ⇒ Object
- #not_rescues!(*exceptions) ⇒ Object
- #not_throws!(symbol) ⇒ Object
-
#raises!(*exceptions) ⇒ Object
Calling the procedure has to raise exactly this exception.
-
#rescues!(*exceptions) ⇒ Object
Calling the procedure has to raise this exception or a kind of it.
-
#throws!(symbol) ⇒ Object
Calling the procedure has to throw this symbol.
Instance Method Details
#not_raises!(*exceptions) ⇒ Object
113 114 115 |
# File 'lib/assay/bang.rb', line 113 def not_raises!(*exceptions) ::RaiseAssay.refute!(*exceptions, {:backtrace=>caller}, &self) end |
#not_rescues!(*exceptions) ⇒ Object
122 123 124 |
# File 'lib/assay/bang.rb', line 122 def not_rescues!(*exceptions) ::RescueAssay.refute!(*exceptions, {:backtrace=>caller}, &self) end |
#not_throws!(symbol) ⇒ Object
131 132 133 |
# File 'lib/assay/bang.rb', line 131 def not_throws!(symbol) ::ThrowAssay.refute!(symbol, {:backtrace=>caller}, &self) end |
#raises!(*exceptions) ⇒ Object
Calling the procedure has to raise exactly this exception.
109 110 111 |
# File 'lib/assay/bang.rb', line 109 def raises!(*exceptions) ::RaiseAssay.assert!(*exceptions, {:backtrace=>caller}, &self) end |
#rescues!(*exceptions) ⇒ Object
Calling the procedure has to raise this exception or a kind of it.
118 119 120 |
# File 'lib/assay/bang.rb', line 118 def rescues!(*exceptions) ::RescueAssay.assert!(*exceptions, {:backtrace=>caller}, &self) end |
#throws!(symbol) ⇒ Object
Calling the procedure has to throw this symbol.
127 128 129 |
# File 'lib/assay/bang.rb', line 127 def throws!(symbol) ::ThrowAssay.assert!(symbol, {:backtrace=>caller}, &self) end |