Sha256: 00b45e167f5b263e14ec88cc4f071143c67297010f24bcbd6a47d01416f03581

Contents?: true

Size: 454 Bytes

Versions: 28

Compression:

Stored size: 454 Bytes

Contents

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

28 entries across 28 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/spec/support/endpoint_faker.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/spec/support/endpoint_faker.rb
grape-1.2.5 spec/support/endpoint_faker.rb
grape-1.2.4 spec/support/endpoint_faker.rb
grape-1.2.3 spec/support/endpoint_faker.rb
grape-1.2.2 spec/support/endpoint_faker.rb
grape-1.2.1 spec/support/endpoint_faker.rb
grape-1.2.0 spec/support/endpoint_faker.rb
grape-1.1.0 spec/support/endpoint_faker.rb
grape-1.0.3 spec/support/endpoint_faker.rb
grape-1.0.2 spec/support/endpoint_faker.rb
grape-1.0.1 spec/support/endpoint_faker.rb
grape-1.0.0 spec/support/endpoint_faker.rb
grape-0.19.2 spec/support/endpoint_faker.rb
grape-0.19.1 spec/support/endpoint_faker.rb
grape-0.19.0 spec/support/endpoint_faker.rb
grape-0.18.0 spec/support/endpoint_faker.rb
grape-0.17.0 spec/support/endpoint_faker.rb
grape-0.16.2 spec/support/endpoint_faker.rb
grape-0.16.1 spec/support/endpoint_faker.rb