Class: Testo::Test
Defined Under Namespace
Classes: FailedAssertion, Report
Constant Summary collapse
- TIMEOUT =
5
Instance Attribute Summary collapse
-
#it ⇒ Object
readonly
Returns the value of attribute it.
Instance Method Summary collapse
- #[](it = nil) ⇒ Object
-
#debug(it) ⇒ Object
Currently, this method is expected to be run from a Pry session only.
-
#initialize(&block) ⇒ Test
constructor
A new instance of Test.
Constructor Details
#initialize(&block) ⇒ Test
Returns a new instance of Test.
24 25 26 |
# File 'lib/testo/test.rb', line 24 def initialize &block @block = block end |
Instance Attribute Details
#it ⇒ Object (readonly)
Returns the value of attribute it.
31 32 33 |
# File 'lib/testo/test.rb', line 31 def it @it end |
Instance Method Details
#[](it = nil) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/testo/test.rb', line 32 def [] it = nil = { test: self, it: it }.merge in_isolation { = { pid: Process.pid } begin run it rescue Exception [:error] = $! end } Report.new end |
#debug(it) ⇒ Object
Currently, this method is expected to be run from a Pry session only.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/testo/test.rb', line 49 def debug it PryByebug::BreakCommand.new.send :add_breakpoint, "Testo::Test#run", nil # How to "next next step" automatically when the breakpoint is hit? begin run it raise "Cannot reproduce. It might be a heisebug." rescue $! end end |