Class: IntegrationWrapper::OnlineTest

Inherits:
ActiveRecord::TestCase
  • Object
show all
Defined in:
lib/integration_wrapper/online_test.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



43
44
45
# File 'lib/integration_wrapper/online_test.rb', line 43

def setup
  IntegrationWrapper.mode = IntegrationWrapper::MODE_ONLINE
end

#switch_to_online_and_backObject

Switch to online and back. Supplanted by the setup and teardown methods.



34
35
36
37
38
39
40
41
# File 'lib/integration_wrapper/online_test.rb', line 34

def switch_to_online_and_back
  # Go to online
  IntegrationWrapper.mode = IntegrationWrapper::MODE_ONLINE
  # yield
  yield
  # Set it back to offline because other tests will be using this as well.
  IntegrationWrapper.mode = IntegrationWrapper::MODE_OFFLINE
end

#teardownObject



47
48
49
# File 'lib/integration_wrapper/online_test.rb', line 47

def teardown
  IntegrationWrapper.mode = IntegrationWrapper::MODE_OFFLINE
end