Class: Turn::Controller
- Inherits:
-
Object
- Object
- Turn::Controller
- Defined in:
- lib/turn/controller.rb
Overview
Controller
– TODO: Add support to test run loggging. ++
Instance Attribute Summary collapse
-
#exclude ⇒ Object
Files globs to specially exclude.
-
#live ⇒ Object
Test against live install (i.e. Don’t use loadpath option).
-
#loadpath ⇒ Object
Add these folders to the $LOAD_PATH.
-
#log ⇒ Object
Log results? May be true/false or log file name.
-
#reporter ⇒ Object
Instance of Reporter.
-
#requires ⇒ Object
Libs to require when running tests.
-
#runner ⇒ Object
Insatance of Runner.
-
#tests ⇒ Object
File glob pattern of tests to run.
-
#verbose ⇒ Object
Verbose output?.
Instance Method Summary collapse
Instance Attribute Details
#exclude ⇒ Object
Files globs to specially exclude.
29 30 31 |
# File 'lib/turn/controller.rb', line 29 def exclude @exclude end |
#live ⇒ Object
Test against live install (i.e. Don’t use loadpath option)
44 45 46 |
# File 'lib/turn/controller.rb', line 44 def live @live end |
#loadpath ⇒ Object
Add these folders to the $LOAD_PATH.
32 33 34 |
# File 'lib/turn/controller.rb', line 32 def loadpath @loadpath end |
#log ⇒ Object
Log results? May be true/false or log file name. (TODO)
47 48 49 |
# File 'lib/turn/controller.rb', line 47 def log @log end |
#reporter ⇒ Object
Instance of Reporter.
38 39 40 |
# File 'lib/turn/controller.rb', line 38 def reporter @reporter end |
#requires ⇒ Object
Libs to require when running tests.
35 36 37 |
# File 'lib/turn/controller.rb', line 35 def requires @requires end |
#runner ⇒ Object
Insatance of Runner.
41 42 43 |
# File 'lib/turn/controller.rb', line 41 def runner @runner end |
#tests ⇒ Object
File glob pattern of tests to run. Can be an array of files/globs.
26 27 28 |
# File 'lib/turn/controller.rb', line 26 def tests @tests end |
#verbose ⇒ Object
Verbose output?
50 51 52 |
# File 'lib/turn/controller.rb', line 50 def verbose @verbose end |
Instance Method Details
#files ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/turn/controller.rb', line 116 def files @files ||= ( fs = tests.map do |t| File.directory?(t) ? Dir[File.join(t, '**', '*')] : Dir[t] end fs = fs.flatten.reject{ |f| File.directory?(f) } ex = exclude.map do |x| File.directory?(x) ? Dir[File.join(x, '**', '*')] : Dir[x] end ex = ex.flatten.reject{ |f| File.directory?(f) } (fs - ex).uniq ) end |
#live? ⇒ Boolean
53 |
# File 'lib/turn/controller.rb', line 53 def live? ; @live ; end |
#requries=(paths) ⇒ Object
112 113 114 |
# File 'lib/turn/controller.rb', line 112 def requries=(paths) @requries = list_option(paths) end |
#start ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/turn/controller.rb', line 130 def start @files = nil # reset files just in case if files.empty? $stderr.puts "No tests." return end testrun = runner.new(self) testrun.start end |
#verbose? ⇒ Boolean
52 |
# File 'lib/turn/controller.rb', line 52 def verbose? ; @verbose ; end |