Class: Avm::Sources::Tests::Single

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/sources/tests/single.rb

Constant Summary collapse

MAIN_SOURCE_ID =
'#main'

Instance Method Summary collapse

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/avm/sources/tests/single.rb', line 21

def failed?
  result == ::Avm::Sources::Tests::Result::FAILED
end

#idString

Returns:

  • (String)


26
27
28
# File 'lib/avm/sources/tests/single.rb', line 26

def id
  "#{main? ? MAIN_SOURCE_ID : relative_path_from_main_source}##{test_name}"
end

#main?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/avm/sources/tests/single.rb', line 30

def main?
  relative_path_from_main_source.to_s == '.'
end

#order_groupObject



34
35
36
# File 'lib/avm/sources/tests/single.rb', line 34

def order_group
  main? ? 1 : 0
end

#relative_path_from_main_sourcePathname

Returns:

  • (Pathname)


39
40
41
# File 'lib/avm/sources/tests/single.rb', line 39

def relative_path_from_main_source
  source.path.relative_path_from(builder.main_source.path)
end