Module: TestHelper::ObjectMixin
- Included in:
- Object
- Defined in:
- lib/testhelper.rb
Instance Method Summary collapse
- #flag_test(title = nil) ⇒ Object
- #ppt(title = nil) ⇒ Object (also: #pretty_print_with_title)
- #pptl(title = nil) ⇒ Object (also: #pretty_print_with_title_lineno)
-
#pt(title = nil) ⇒ Object
(also: #puts_with_title)
It will pretty print the self, with title.
- #ptl(title = nil) ⇒ Object (also: #puts_with_title_lineno)
Instance Method Details
#flag_test(title = nil) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/testhelper.rb', line 45 def flag_test(title=nil) location_str = caller()[0] puts("\n"+location_str) if title == nil title = "" else title = title+" : " end puts(title+"There are test codes in this place!") self end |
#ppt(title = nil) ⇒ Object Also known as: pretty_print_with_title
26 27 28 29 30 31 32 33 34 |
# File 'lib/testhelper.rb', line 26 def ppt(title=nil) location_str = caller()[0] if title == nil title = SourceFile.get_variable_name(location_str, __callee__) end puts("#{title} :") pp(self) self end |
#pptl(title = nil) ⇒ Object Also known as: pretty_print_with_title_lineno
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/testhelper.rb', line 35 def pptl(title=nil) location_str = caller()[0] puts("\n"+location_str) if title == nil title = SourceFile.get_variable_name(location_str, __callee__) end puts("#{title} : ") pp(self) self end |
#pt(title = nil) ⇒ Object Also known as: puts_with_title
It will pretty print the self, with title.
9 10 11 12 13 14 15 16 |
# File 'lib/testhelper.rb', line 9 def pt(title=nil) location_str = caller()[0] if title == nil title = SourceFile.get_variable_name(location_str, __callee__) end puts("#{title} : #{self.inspect()}") self end |
#ptl(title = nil) ⇒ Object Also known as: puts_with_title_lineno
17 18 19 20 21 22 23 24 25 |
# File 'lib/testhelper.rb', line 17 def ptl(title=nil) location_str = caller()[0] puts("\n"+location_str) if title == nil title = SourceFile.get_variable_name(location_str, __callee__) end puts("#{title} : #{self.inspect()}") self end |