Sha256: 98df492a8bbb8cad5d675c665a0898d63162f621480de037dc4966c6977dad9d

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

module Spec
  module Support
    # container for methods used in specs
    module RouteMatcherHelpers
      def self.api
        Class.new(Grape::API) do
          version 'v1'
          prefix 'api'
          format 'json'

          get 'ping' do
            'pong'
          end

          resource :cats do
            get '/' do
              %w(cats cats cats)
            end

            route_param :id do
              get do
                'cat'
              end
            end
          end

          route :any, '*path' do
            'catch-all route'
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grape-route-helpers-1.0.1 spec/support/route_matcher_helpers.rb
grape-route-helpers-1.0.0 spec/support/route_matcher_helpers.rb