Module: ShamRack

Extended by:
Registration
Defined in:
lib/sham_rack.rb,
lib/sham_rack/version.rb,
lib/sham_rack/allowances.rb,
lib/sham_rack/registration.rb,
lib/sham_rack/stub_web_service.rb,
lib/sham_rack/net_http.rb

Overview

ShamRack allows access to Rack applications using Net::Http, but without network traffic.

For more detail, see github.com/mdub/sham_rack

Defined Under Namespace

Modules: NetHttp, Registration Classes: MountPoint, NetworkConnectionPrevented, StubWebService

Constant Summary collapse

VERSION =
"1.4.1"

Constants included from Registration

Registration::ADDRESS_PATTERN

Class Method Summary collapse

Methods included from Registration

application_for, at, unmount_all

Class Method Details

.allow_network_connectionsObject



9
10
11
# File 'lib/sham_rack/allowances.rb', line 9

def allow_network_connections
  @allow_network_connections = true
end

.network_connections_allowed?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/sham_rack/allowances.rb', line 5

def network_connections_allowed?
  @allow_network_connections
end

.prevent_network_connectionsObject



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

def prevent_network_connections
  @allow_network_connections = false
end

.resetObject



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

def self.reset
  unmount_all
  allow_network_connections
end