Module: Minitest
- Defined in:
- lib/minitest/log_level_plugin.rb,
lib/minitest/environment_plugin.rb
Overview
Add environment option to minitest
Constant Summary collapse
- LEVEL_ALIASES =
{ 'debug' => Logger::DEBUG, 'info' => Logger::INFO, 'warning' => Logger::WARN, 'error' => Logger::ERROR, }
Class Method Summary collapse
- .plugin_environment_init(options) ⇒ Object
- .plugin_environment_options(opts, options) ⇒ Object
- .plugin_log_level_init(options) ⇒ Object
- .plugin_log_level_options(opts, options) ⇒ Object
Class Method Details
.plugin_environment_init(options) ⇒ Object
27 28 29 30 |
# File 'lib/minitest/environment_plugin.rb', line 27 def self.plugin_environment_init() name = [:environment] Cisco::Environment.default_environment_name = name unless name.nil? end |
.plugin_environment_options(opts, options) ⇒ Object
21 22 23 24 25 |
# File 'lib/minitest/environment_plugin.rb', line 21 def self.(opts, ) opts.on('-e', '--environment NAME', 'Select environment by name') do |name| [:environment] = name end end |
.plugin_log_level_init(options) ⇒ Object
38 39 40 |
# File 'lib/minitest/log_level_plugin.rb', line 38 def self.plugin_log_level_init() Cisco::Logger.level = [:log_level] if [:log_level] end |
.plugin_log_level_options(opts, options) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/minitest/log_level_plugin.rb', line 28 def self.(opts, ) opts.on( '-l', '--log-level LEVEL', LEVEL_ALIASES, 'Configure logging level for tests', "(#{LEVEL_ALIASES.keys.join(', ')})" ) do |level| [:log_level] = level end end |