Class: Spec::Example::ExampleGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/rspec/rspec_extensions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#execution_errorObject (readonly)

Returns the value of attribute execution_error.



16
17
18
# File 'lib/selenium/rspec/rspec_extensions.rb', line 16

def execution_error
  @execution_error
end

Instance Method Details

#execute(options, instance_variables) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/selenium/rspec/rspec_extensions.rb', line 18

def execute(options, instance_variables)
  options.reporter.example_started(self)
  set_instance_variables_from_hash(instance_variables)
  
  @execution_error = nil
  Timeout.timeout(options.timeout) do
    begin
      before_example
      run_with_description_capturing
    rescue Exception => e
      @execution_error ||= e
    end
    begin
      after_example
    rescue Exception => e
      @execution_error ||= e
    end
  end

  options.reporter.example_finished(self, @execution_error)
  success = @execution_error.nil? || ExamplePendingError === @execution_error
end