Class: SixthSense::Model::TestFile

Inherits:
Struct
  • Object
show all
Defined in:
lib/sixth_sense/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#frameworkObject

Returns the value of attribute framework

Returns:

  • (Object)

    the current value of framework



9
10
11
# File 'lib/sixth_sense/model.rb', line 9

def framework
  @framework
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



9
10
11
# File 'lib/sixth_sense/model.rb', line 9

def 
  @metadata
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



9
10
11
# File 'lib/sixth_sense/model.rb', line 9

def path
  @path
end

#sut_candidatesObject

Returns the value of attribute sut_candidates

Returns:

  • (Object)

    the current value of sut_candidates



9
10
11
# File 'lib/sixth_sense/model.rb', line 9

def sut_candidates
  @sut_candidates
end

#test_casesObject

Returns the value of attribute test_cases

Returns:

  • (Object)

    the current value of test_cases



9
10
11
# File 'lib/sixth_sense/model.rb', line 9

def test_cases
  @test_cases
end

Instance Method Details

#assertionsObject



17
18
19
# File 'lib/sixth_sense/model.rb', line 17

def assertions
  test_cases.flat_map(&:assertions)
end

#executable_locObject



21
22
23
# File 'lib/sixth_sense/model.rb', line 21

def executable_loc
  test_cases.sum(&:executable_loc)
end

#to_hObject



25
26
27
28
29
30
31
32
33
# File 'lib/sixth_sense/model.rb', line 25

def to_h
  {
    path: path,
    framework: framework,
    test_cases: test_cases.map(&:to_h),
    sut_candidates: sut_candidates.map(&:to_h),
    metadata:  || {}
  }
end