Sha256: 502b94e224aee78c783469b382280a82d0eef7841ace13b0cc044fef1d5d7868
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 KB
Contents
require "rubygems" gem "rspec", "=1.1.8" require 'spec' require 'spec/example/example_group' # # Monkey-patch RSpec Example Group so that we can track whether an # example already failed or not in an after(:each) block # # useful to only capture Selenium screenshots when a test fails # # Only changed execution_error to be an instance variable (in lieu of # a local variable). # module Spec module Example class ExampleGroup attr_reader :execution_error 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 eval_block 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 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
selenium-client-1.2.7 | lib/selenium/rspec/rspec_extensions.rb |
selenium-client-1.2.6 | lib/selenium/rspec/rspec_extensions.rb |