Class: Mutiny::Tests::TestRun

Inherits:
Object
  • Object
show all
Defined in:
lib/mutiny/tests/test_run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tests:, passed_tests:, failed_tests:, output:, runtime:) ⇒ TestRun

Returns a new instance of TestRun.



6
7
8
9
10
11
12
# File 'lib/mutiny/tests/test_run.rb', line 6

def initialize(tests:, passed_tests:, failed_tests:, output:, runtime:)
  @tests = tests
  @passed_tests = passed_tests
  @failed_tests = failed_tests
  @output = output
  @runtime = runtime
end

Instance Attribute Details

#failed_testsObject (readonly)

Returns the value of attribute failed_tests.



4
5
6
# File 'lib/mutiny/tests/test_run.rb', line 4

def failed_tests
  @failed_tests
end

#outputObject (readonly)

Returns the value of attribute output.



4
5
6
# File 'lib/mutiny/tests/test_run.rb', line 4

def output
  @output
end

#passed_testsObject (readonly)

Returns the value of attribute passed_tests.



4
5
6
# File 'lib/mutiny/tests/test_run.rb', line 4

def passed_tests
  @passed_tests
end

#runtimeObject (readonly)

Returns the value of attribute runtime.



4
5
6
# File 'lib/mutiny/tests/test_run.rb', line 4

def runtime
  @runtime
end

#testsObject (readonly)

Returns the value of attribute tests.



4
5
6
# File 'lib/mutiny/tests/test_run.rb', line 4

def tests
  @tests
end

Instance Method Details

#executed_countObject



14
15
16
# File 'lib/mutiny/tests/test_run.rb', line 14

def executed_count
  passed_tests.size + failed_tests.size
end

#failed?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/mutiny/tests/test_run.rb', line 22

def failed?
  !passed?
end

#passed?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/mutiny/tests/test_run.rb', line 18

def passed?
  failed_tests.empty?
end