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



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

def setup
  IntegrationWrapper::Base.mode = IntegrationWrapper::Base::MODE_ONLINE
end

#switch_to_online_and_backObject

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



39
40
41
42
43
44
45
46
# File 'lib/integration_wrapper/online_test.rb', line 39

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

#teardownObject



52
53
54
# File 'lib/integration_wrapper/online_test.rb', line 52

def teardown
  IntegrationWrapper::Base.mode = IntegrationWrapper::Base::MODE_OFFLINE
end