Class: JayUnit::Test
- Inherits:
-
Object
- Object
- JayUnit::Test
- Defined in:
- lib/jay_unit.rb
Overview
This is the class you inherit from. And define a method called test can also override setup so that you can have some instance vars around
Instance Method Summary collapse
-
#initialize ⇒ Test
constructor
A new instance of Test.
-
#note(arg) ⇒ Object
proxy methods.
- #phail(arg) ⇒ Object
- #report ⇒ Object
-
#run ⇒ Object
You must override this method.
- #section(name, &block) ⇒ Object
- #setup ⇒ Object
- #succeed(arg) ⇒ Object
Constructor Details
#initialize ⇒ Test
Returns a new instance of Test.
48 49 50 51 52 53 54 55 |
# File 'lib/jay_unit.rb', line 48 def initialize $ses = 0 $fls = 0 _setup setup _start run end |
Instance Method Details
#note(arg) ⇒ Object
proxy methods
63 64 65 |
# File 'lib/jay_unit.rb', line 63 def note arg JayUnit.note arg end |
#report ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/jay_unit.rb', line 77 def report s = %Q[ --------------- RESULTS ------------------ SUCCESSES: #{$ses} PHAILURES:#{$fls} ------------------------------------------ ] puts s end |
#run ⇒ Object
You must override this method
59 60 61 |
# File 'lib/jay_unit.rb', line 59 def run raise "You must override the run function in your class!" end |
#section(name, &block) ⇒ Object
72 73 74 75 76 |
# File 'lib/jay_unit.rb', line 72 def section name,&block puts "------* [#{name}] *------" yield report end |
#setup ⇒ Object
56 57 58 |
# File 'lib/jay_unit.rb', line 56 def setup # You must override this method end |