spec/spec_helper.rb in p2ruby-0.1.2 vs spec/spec_helper.rb in p2ruby-0.1.4

- old
+ new

@@ -17,33 +17,28 @@ MESSAGE_INI = CONFIG_DIR + 'p2fortsgate_messages.ini' TABLESET_INI = CONFIG_DIR + 'rts_index.ini' ROUTER_INI = CONFIG_DIR + 'client_router.ini' ROUTER_PATH = TEST_DIR + 'p2bin/P2MQRouter.exe' ROUTER_ARGS = "/ini:#{ROUTER_INI}" -ROUTER_LOGIN = "FORTS_FZ36001_" # Login (incomplete) to RTS test server -ROUTER_TITLE = Regexp.new('P2MQRouter - ') # + ROUTER_LOGIN +ROUTER_LOGIN = "FORTS_FZ36" # Login (incomplete) to RTS test server +ROUTER_TITLE = Regexp.new('P2MQRouter - ') +SERVER_NAME = 'FINTER_FORTS3.SQLProxy1' # @conn.ResolveService("FORTS_SRV") RSpec.configure do |config| # config.exclusion_filter = { :slow => true } # config.filter = { :focus => true } # config.include(UserExampleHelpers) + # config.fail_fast = true end def show_ole print 'Implemented OLE types: '; p subject.ole_type.implemented_ole_types print 'Source OLE types: '; p subject.ole_type.source_ole_types print 'OLE methods: ' p subject.ole_methods.map { |m| "#{m.invoke_kind} #{m.name}(#{m.params.join ', '})" }.sort end -# Closes any open Router application -def stop_router - while router_app = WinGui::App.find(:title => ROUTER_TITLE) - router_app.exit(timeout=10) - end -end - # Starts new Router application. Options: # :force - force Router to start, even if it's already running (default *false*) # :title - look for specific Router title # :dir - cd to this dir before starting router # :path - start Router at specific path @@ -66,13 +61,24 @@ def restart_router stop_router start_router :force => true end +# Closes any open Router application +def stop_router + while router_app = WinGui::App.find(:title => ROUTER_TITLE) + router_app.exit(timeout=10) + end +end + # Prepares test stand by copying P2 files to /tmp def prepare_test_stand + unless CONFIG_DIR.exist? + puts "Unable to rum specs - .ini not found. Put all your .ini files into #{CONFIG_DIR}!" + RSpec.wants_to_quit=true + end + FileUtils.rm_rf TMP_DIR FileUtils.cp_r SOURCE_DIR, TEST_DIR #TMP_DIR end prepare_test_stand -#FileUtils.cd "#{TEST_DIR}"