Sha256: 1ef262eacc6235b73b61a766c186900bbcc5b89388321a7bd756432f57b1421f

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

require 'fitting/version'
require 'fitting/configuration'
require 'fitting/documentation/response/route'
require 'fitting/documentation/request/route'
require 'fitting/storage/responses'
require 'fitting/storage/documentation'
require 'fitting/storage/skip'
require 'fitting/matchers/response_matcher'

module Fitting
  class << self
    def configure
      yield configuration
    end

    def configuration
      @configuration ||= Configuration.new
    end
  end
end

module RSpec
  module Core
    # Provides the main entry point to run a suite of RSpec examples.
    class Runner
      alias origin_run_specs run_specs

      def run_specs(example_groups)
        origin_run_specs(example_groups)

        return if Fitting::Storage::Skip.get

        response_routes = Fitting::Documentation::Response::Route.new(
          Fitting::Storage::Documentation.hash,
          Fitting::Storage::Responses.all
        )
        request_routes = Fitting::Documentation::Request::Route.new(response_routes)

        request_routes.conformity_lists
        request_routes.statistics
        response_routes.statistics

        exit if response_routes.not_coverage.present? && Fitting.configuration.crash_not_implemented_response
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fitting-1.2.0 lib/fitting.rb