Class: Avm::EacRubyBase1::Sources::Tester

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

Constant Summary collapse

BUNDLE_TEST_COMMAND_CONFIGURATION_KEY =
:bundle_test_command

Instance Method Summary collapse

Instance Method Details

#bundle_test_commandEacRubyGemsUtils::Gem::Command?

Returns:

  • (EacRubyGemsUtils::Gem::Command, nil)


20
21
22
23
# File 'lib/avm/eac_ruby_base1/sources/tester.rb', line 20

def bundle_test_command
  source.read_configuration_as_shell_words(BUNDLE_TEST_COMMAND_CONFIGURATION_KEY)
    .if_present { |args| the_gem.bundle(*args).chdir_root }
end

#default_test_commandEacRubyGemsUtils::Gem::Command?

Returns:

  • (EacRubyGemsUtils::Gem::Command, nil)


26
27
28
# File 'lib/avm/eac_ruby_base1/sources/tester.rb', line 26

def default_test_command
  the_gem.bundle('exec', 'rspec', '--fail-fast').chdir_root
end

#run_test_commandObject



30
31
32
33
34
# File 'lib/avm/eac_ruby_base1/sources/tester.rb', line 30

def run_test_command
  execute_command_and_log(the_gem.bundle('install').chdir_root) ||
    execute_command_and_log(the_gem.bundle('update').chdir_root)
  super
end

#test_commandEacRubyUtils::Envs::Command?

Returns:

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


15
16
17
# File 'lib/avm/eac_ruby_base1/sources/tester.rb', line 15

def test_command
  bundle_test_command || super || default_test_command
end