Module: DuckTest::ConfigHelper
- Included in:
- FrameWork::Base, FrameWork::FileManager, FrameWork::Map, FrameWork::Queue, FrameWork::WatchConfig
- Defined in:
- lib/duck_test/config_helper.rb
Overview
For inclusion in classes that need the standard attributes
Instance Method Summary (collapse)
-
- (Boolean) autorun
Controls if tests/specs should be run automatically when changed.
-
- (Boolean) autorun=(value)
Sets if tests/specs should be run automatically when changed.
-
- (Boolean) autorun?
Returns true is autorun is enabled, otherwise, returns false.
-
- (String) autorun_status
Constructs a message indicating the current status of autorun.
-
- (String) root
Root directory for all files to watch.
-
- (String) root=(value)
Sets the root directory for all files to watch.
-
- (String) runnable_basedir
The runnable_basedir is used when evaluating directories and files and it's main purpose is to provide the conveinence of not having to specify full directory paths in runnable definitions.
-
- (String) runnable_basedir=(value)
Sets the current of runnable_basedir.
-
- (String) watch_basedir
The watch_basedir is used when evaluating directories and files and it's main purpose is to provide the conveinence of not having to specify full directory paths in watch definitions.
-
- (String) watch_basedir=(value)
Sets the current of watch_basedir.
Instance Method Details
- (Boolean) autorun
Controls if tests/specs should be run automatically when changed.
71 72 73 74 |
# File 'lib/duck_test/config_helper.rb', line 71 def autorun @autorun = true unless defined? @autorun @autorun end |
- (Boolean) autorun=(value)
Sets if tests/specs should be run automatically when changed. A value of true means test will be automatically run, otherwise, tests have to be run manually.
87 88 89 |
# File 'lib/duck_test/config_helper.rb', line 87 def autorun=(value) @autorun = value end |
- (Boolean) autorun?
Returns true is autorun is enabled, otherwise, returns false.
79 80 81 |
# File 'lib/duck_test/config_helper.rb', line 79 def autorun? @autorun end |
- (String) autorun_status
Constructs a message indicating the current status of autorun.
94 95 96 |
# File 'lib/duck_test/config_helper.rb', line 94 def autorun_status return "Autorun is #{self.autorun ? 'ON' : 'OFF'}" end |
- (String) root
Root directory for all files to watch. Typically, this will equate to Rails.root The default value is the current directory '.'
puts DuckTest::Config.root # '.'
13 14 15 |
# File 'lib/duck_test/config_helper.rb', line 13 def root return @root ||= "." end |
- (String) root=(value)
Sets the root directory for all files to watch. Typically, this will equate to Rails.root The default value is the current directory '.', however, DuckTest::Config will set this value to the Rails.root directory if being loaded in a Rails environment. The purpose of this attribute is to account for the event that a development environment might deviate slightly from the standard to compensate for an unknown requirement.
DuckTest::Config.root = "/my_directory"
puts DuckTest::Config.root # => '/my_directory'
28 29 30 31 32 |
# File 'lib/duck_test/config_helper.rb', line 28 def root=(value) @root = value.to_s unless value.blank? @root = File.(@root) unless @root.blank? return @root end |
- (String) runnable_basedir
See README for details and examples
The runnable_basedir is used when evaluating directories and files and it's main purpose is to provide the conveinence of not having to specify full directory paths in runnable definitions.
57 58 59 |
# File 'lib/duck_test/config_helper.rb', line 57 def runnable_basedir return @runnable_basedir ||= "" end |
- (String) runnable_basedir=(value)
Sets the current of runnable_basedir.
64 65 66 |
# File 'lib/duck_test/config_helper.rb', line 64 def runnable_basedir=(value) @runnable_basedir = value.to_s unless value.blank? end |
- (String) watch_basedir
See README for details and examples
The watch_basedir is used when evaluating directories and files and it's main purpose is to provide the conveinence of not having to specify full directory paths in watch definitions.
40 41 42 |
# File 'lib/duck_test/config_helper.rb', line 40 def watch_basedir return @watch_basedir ||= "" end |
- (String) watch_basedir=(value)
Sets the current of watch_basedir.
47 48 49 |
# File 'lib/duck_test/config_helper.rb', line 47 def watch_basedir=(value) @watch_basedir = value.to_s unless value.blank? end |