Class: PseudoExampleFailed

Inherits:
PseudoExample show all
Defined in:
lib/onlyoffice_tcm_helper/models/pseudo_example_failed.rb

Overview

class is describe object like RSpec::Core::Example with error in expected code

Instance Attribute Summary

Attributes inherited from PseudoExample

#description, #execution_result

Instance Method Summary collapse

Methods inherited from PseudoExample

#pending?

Constructor Details

#initialize(description = 'Check something', exception_with_failed_lines: false) ⇒ PseudoExampleFailed

Returns a new instance of PseudoExampleFailed.



7
8
9
10
11
# File 'lib/onlyoffice_tcm_helper/models/pseudo_example_failed.rb', line 7

def initialize(description = 'Check something',
               exception_with_failed_lines: false)
  @exception_with_failed_lines = exception_with_failed_lines
  super(description)
end

Instance Method Details

#exceptionObject

Returns exception data.

Returns:

  • (Object)

    exception data



23
24
25
26
27
28
# File 'lib/onlyoffice_tcm_helper/models/pseudo_example_failed.rb', line 23

def exception
  return MockFailedException.new if @exception_with_failed_lines

  'expected: falsey value
   got: true'
end

#metadataHash

Returns metadata of class.

Returns:

  • (Hash)

    metadata of class



14
15
16
17
18
19
20
# File 'lib/onlyoffice_tcm_helper/models/pseudo_example_failed.rb', line 14

def 
  {
    description: 'Test for create failed status result',
    execution_result: ExecutingResult.new,
    absolute_file_path: "#{Dir.pwd}/spec/onlyoffice_tcm_helper_spec.rb"
  }
end