Sha256: 732c175d7bf02e708601f7575ef50c6aa3849e3a090091bbb113f7db2aebb2bb

Contents?: true

Size: 973 Bytes

Versions: 3

Compression:

Stored size: 973 Bytes

Contents

module Spec

  module Example

    module ExampleMethods

      # include Spec::Matchers

      def initialize(example_proxy, &implementation)
        @example_proxy = example_proxy
        @implementation = implementation
      end

      def before_each_example
        run_before_each
      end

      def run_before_each
        example_group_hierarchy.run_before_each self
      end

      def example_group_hierarchy
        self.class.example_group_hierarchy
      end

      def description
        @example_proxy.description
      end

      def execute(run_options, instance_variables)
        run_options.reporter.example_started @example_proxy
        execution_error = nil

        begin
          before_each_example
          instance_eval(&@implementation)
        rescue Exception => e
          execution_error = e
        end

        run_options.reporter.example_finished @example_proxy.update(description), execution_error
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-0.3.2 gems/ospec/lib/ospec/example/example_methods.rb
opal-0.3.1 gems/ospec/lib/ospec/example/example_methods.rb
opal-0.3.0 gems/ospec/lib/ospec/example/example_methods.rb