Sha256: 951cb69eb58ca5924b78381653a14f84d08125cc72f017c24dcd39c174cf6589

Contents?: true

Size: 727 Bytes

Versions: 3

Compression:

Stored size: 727 Bytes

Contents

require 'rspec/api_helpers/version'
require 'rspec/api_helpers/dispatcher'
require 'rspec/api_helpers/example_methods'
require 'rspec/api_helpers/example_group_methods'

module Rspec

  module ApiHelpers
    class << self;
      attr_accessor :adapter
    end

    def self.included(receiver)
      receiver.extend         ExampleGroupMethods
      receiver.send :include, ExampleMethods
    end

    def self.with(adapter:)
      if adapter.is_a?(Class)
        self.adapter = adapter
      else
        case adapter.to_s.to_sym
        when :active_model
          self.adapter = Adapter::ActiveModel
        when :json_api
          self.adapter = Adapter::JsonApi
        end
      end

      return self
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-api_helpers-1.0.4 lib/rspec/api_helpers.rb
rspec-api_helpers-1.0.3 lib/rspec/api_helpers.rb
rspec-api_helpers-1.0.2 lib/rspec/api_helpers.rb