Sha256: ca9aec24af4baa8dc265737f1f03eace8267b07689755c4b2ae9b72b414f9178

Contents?: true

Size: 485 Bytes

Versions: 16

Compression:

Stored size: 485 Bytes

Contents

# frozen_string_literal: true

module Spec
  module Support
    class EndpointFaker
      class FakerAPI < Grape::API
        get '/' do
        end
      end

      def initialize(app, endpoint = FakerAPI.endpoints.first)
        @app = app
        @endpoint = endpoint
      end

      def call(env)
        @endpoint.instance_exec do
          @request = Grape::Request.new(env.dup)
        end

        @app.call(env.merge('api.endpoint' => @endpoint))
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
grape-1.8.0 spec/support/endpoint_faker.rb
grape-1.7.1 spec/support/endpoint_faker.rb
grape-1.7.0 spec/support/endpoint_faker.rb
grape-1.6.2 spec/support/endpoint_faker.rb
grape-1.6.1 spec/support/endpoint_faker.rb
grape-1.6.0 spec/support/endpoint_faker.rb
grape-1.5.3 spec/support/endpoint_faker.rb
grape-1.5.2 spec/support/endpoint_faker.rb
grape-1.5.1 spec/support/endpoint_faker.rb
grape-1.5.0 spec/support/endpoint_faker.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/spec/support/endpoint_faker.rb
grape-1.4.0 spec/support/endpoint_faker.rb
grape-1.3.3 spec/support/endpoint_faker.rb
grape-1.3.2 spec/support/endpoint_faker.rb
grape-1.3.1 spec/support/endpoint_faker.rb
grape-1.3.0 spec/support/endpoint_faker.rb