Module: Adapters::Integration

Defined in:
test/adapters/integration.rb

Overview

Adapter integration tests. To use, implement two methods:

`#adapter` required. returns a symbol for the adapter middleware name `#adapter_options` optional. extra arguments for building an adapter

Defined Under Namespace

Modules: Common, Compression, NonParallel, Parallel, SSL

Class Method Summary collapse

Class Method Details

.apply(base, *extra_features) ⇒ Object


11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'test/adapters/integration.rb', line 11

def self.apply(base, *extra_features)
  if base.live_server?
    features = [:Common]
    features.concat extra_features
    features << :SSL if base.ssl_mode?
    features.each {|name| base.send(:include, self.const_get(name)) }
    yield if block_given?
  elsif !defined? @warned
    warn "Warning: Not running integration tests against a live server."
    warn "Start the server `ruby test/live_server.rb` and set the LIVE=1 env variable."
    @warned = true
  end
end