Module: AsyncRackTest::Methods

Includes:
Rack::Test::Methods
Defined in:
lib/async_rack_test.rb

Instance Method Summary collapse

Instance Method Details

#async_appObject

The original app



13
14
15
# File 'lib/async_rack_test.rb', line 13

def async_app
  @async_app ||= app
end

#sync_appObject



16
17
18
19
20
# File 'lib/async_rack_test.rb', line 16

def sync_app
  @sync_app ||= begin
    ResyncApp.new(async_app)
  end
end

#use_asyncObject



26
27
28
29
# File 'lib/async_rack_test.rb', line 26

def use_async
  async_app # Ensure we have cached the original app first.
  self.instance_eval { class << self; self; end }.class_eval { alias :app :async_app }
end

#use_syncObject



22
23
24
25
# File 'lib/async_rack_test.rb', line 22

def use_sync
  async_app # Ensure we have cached the original app first.
  self.instance_eval { class << self; self; end }.class_eval { alias :app :sync_app }
end