Module: Avm::Sources::Base::Testing
- Defined in:
- lib/avm/sources/base/testing.rb
Constant Summary collapse
- DEFAULT_TEST_COMMANDS =
{}.freeze
- TEST_KEY =
'test'
- TEST_COMMAND_KEY =
"#{TEST_KEY}.command"
- TEST_COMMANDS_KEY =
"#{TEST_KEY}.commands"
Instance Method Summary collapse
- #configured_test_command ⇒ Object
- #configured_test_commands ⇒ Hash<String, EacRubyUtils::Envs::Command>?
- #configured_value_as_test_commands(value) ⇒ Hash<String, EacRubyUtils::Envs::Command>?
- #default_test_commands ⇒ Hash<String, EacRubyUtils::Envs::Command>
- #test_commands ⇒ Enumerable<EacRubyUtils::Envs::Command>
Instance Method Details
#configured_test_command ⇒ Object
12 13 14 |
# File 'lib/avm/sources/base/testing.rb', line 12 def configured_test_command read_configuration_as_env_command(TEST_COMMAND_KEY) end |
#configured_test_commands ⇒ Hash<String, EacRubyUtils::Envs::Command>?
17 18 19 |
# File 'lib/avm/sources/base/testing.rb', line 17 def configured_test_commands configured_value_as_test_commands(configuration_entry(TEST_COMMANDS_KEY).value) end |
#configured_value_as_test_commands(value) ⇒ Hash<String, EacRubyUtils::Envs::Command>?
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/avm/sources/base/testing.rb', line 22 def configured_value_as_test_commands(value) return nil if value.nil? [::EacRubyUtils::Envs::Command, ::Hash, ::Enumerable].each do |type| next unless value.is_a?(type) return send( "configured_#{type.name.demodulize.variableize}_value_as_test_commands", value ) end raise "Value for test commands should be a Hash or a Enumerable (Actual: #{value})" end |
#default_test_commands ⇒ Hash<String, EacRubyUtils::Envs::Command>
38 39 40 |
# File 'lib/avm/sources/base/testing.rb', line 38 def default_test_commands DEFAULT_TEST_COMMANDS end |
#test_commands ⇒ Enumerable<EacRubyUtils::Envs::Command>
43 44 45 46 47 |
# File 'lib/avm/sources/base/testing.rb', line 43 def test_commands configured_test_commands || configured_value_as_test_commands(configured_test_command) || default_test_commands end |