Class: TestCentricity::ExceptionQueue

Inherits:
Object
  • Object
show all
Defined in:
lib/testcentricity_web/exception_queue_helper.rb

Class Method Summary collapse

Class Method Details

.enqueue_assert_equal(expected, actual, error_message) ⇒ Object



5
6
7
8
9
10
# File 'lib/testcentricity_web/exception_queue_helper.rb', line 5

def self.enqueue_assert_equal(expected, actual, error_message)
  unless expected == actual
    @error_queue = "#{@error_queue}#{error_message} to be\n  #{expected}\nbut found\n  #{actual}\n\n"
    save_screenshot
  end
end

.enqueue_assert_not_equal(expected, actual, error_message) ⇒ Object



12
13
14
15
16
17
# File 'lib/testcentricity_web/exception_queue_helper.rb', line 12

def self.enqueue_assert_not_equal(expected, actual, error_message)
  unless expected != actual
    @error_queue = "#{@error_queue}#{error_message} to not be equal to #{expected}\n\n"
    save_screenshot
  end
end

.enqueue_exception(error_message) ⇒ Object



19
20
21
# File 'lib/testcentricity_web/exception_queue_helper.rb', line 19

def self.enqueue_exception(error_message)
  @error_queue = "#{@error_queue}#{error_message}\n\n"
end

.post_exceptionsObject



23
24
25
26
27
# File 'lib/testcentricity_web/exception_queue_helper.rb', line 23

def self.post_exceptions
  raise @error_queue unless @error_queue.nil?
ensure
  @error_queue = nil
end