Class: Avm::EacGenericBase0::Sources::Tester

Inherits:
Sources::Tester
  • Object
show all
Defined in:
lib/avm/eac_generic_base0/sources/tester.rb

Constant Summary collapse

TEST_COMMAND_CONFIGURATION_KEY =
:test_command

Instance Method Summary collapse

Instance Method Details

#logsEacFs::Logs

Returns:

  • (EacFs::Logs)


23
24
25
# File 'lib/avm/eac_generic_base0/sources/tester.rb', line 23

def logs
  @logs ||= ::EacFs::Logs.new.add(:stdout).add(:stderr)
end

#resultAvm::Sources::Tests::Result

Returns:

  • (Avm::Sources::Tests::Result)


28
29
30
31
32
33
34
35
36
37
38
# File 'lib/avm/eac_generic_base0/sources/tester.rb', line 28

def result
  @result ||= begin
    if test_command.blank?
      ::Avm::Sources::Tests::Result::NONEXISTENT
    elsif run_test_command
      ::Avm::Sources::Tests::Result::SUCESSFUL
    else
      ::Avm::Sources::Tests::Result::FAILED
    end
  end
end

#test_commandEacRubyUtils::Envs::Command?

Returns:

  • (EacRubyUtils::Envs::Command, nil)


15
16
17
18
19
20
# File 'lib/avm/eac_generic_base0/sources/tester.rb', line 15

def test_command
  source.read_configuration_as_shell_words(TEST_COMMAND_CONFIGURATION_KEY)
        .if_present do |args|
    ::EacRubyUtils::Envs.local.command(args).chdir(source.path)
  end
end