Module: Tap::Test::TapTest

Defined in:
lib/tap/test/tap_test.rb

Overview

Sets up and tears down Tap::App.instance. This prevents tests that modify either from inadvertently conflicting with one another.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject (readonly)

The test specific app



11
12
13
# File 'lib/tap/test/tap_test.rb', line 11

def app
  @app
end

Instance Method Details

#app_configObject



22
23
24
# File 'lib/tap/test/tap_test.rb', line 22

def app_config
  {:debug => true, :quiet => true, :env => Tap::Env.new(env_config)}
end

#env_configObject



18
19
20
# File 'lib/tap/test/tap_test.rb', line 18

def env_config
  {:gems => :none, :root => @method_root || Dir.pwd}
end

#setupObject



13
14
15
16
# File 'lib/tap/test/tap_test.rb', line 13

def setup
  super
  Tap::App.instance = @app = Tap::App.new(app_config)
end

#teardownObject



26
27
28
29
# File 'lib/tap/test/tap_test.rb', line 26

def teardown
  Tap::App.instance = nil
  super
end