Class: PublicanCreatorsTest
- Inherits:
-
Object
- Object
- PublicanCreatorsTest
- Defined in:
- lib/publican_creators/testlib.rb
Overview
Class for methods in testing environment
Class Method Summary collapse
-
.check_content(file, pattern) ⇒ String
Method for checking file content.
-
.cleanup ⇒ Object
Method for cleanup the test results.
Class Method Details
.check_content(file, pattern) ⇒ String
Method for checking file content
25 26 27 28 29 30 31 |
# File 'lib/publican_creators/testlib.rb', line 25 def self.check_content(file, pattern) f = File.new(file) text = f.read result = 'false' # Default false result = 'true' if text =~ /"#{pattern}"/ # if found true return result end |
.cleanup ⇒ Object
Method for cleanup the test results
34 35 36 |
# File 'lib/publican_creators/testlib.rb', line 34 def self.cleanup system('rm -rf The_holy_Bible*') end |