auto_test 0.0.9.3.3 → 0.0.9.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module AutoTest
2
- VERSION = "0.0.9.3.3"
2
+ VERSION = "0.0.9.3.4"
3
3
  end
@@ -28,7 +28,7 @@ end
28
28
 
29
29
  def init_user_inputs
30
30
  @user_inputs = Hash.new
31
- file = File.new("#{GEMPATH}/../../log/user_input.log", "r")
31
+ file = File.new("#{gem_path}/../../log/user_input.log", "r")
32
32
  while line = file.gets do
33
33
  b = line.split(/:/,2)
34
34
  @user_inputs["#{b[0].strip}"] = b[1].chop
@@ -83,7 +83,7 @@ def add_path(value)
83
83
  end
84
84
 
85
85
  def search_sessions
86
- path_to_search = File.new("#{GEMPATH}/../../log/new_path.log")
86
+ path_to_search = File.new("#{gem_path}/../../log/new_path.log")
87
87
  sessions = Array.new
88
88
  while line = path_to_search.gets do
89
89
  line.gsub!(/[{}\"]/,'')
@@ -105,7 +105,7 @@ init_path
105
105
  init_sessions_array
106
106
  init_user_inputs
107
107
  puts "Firefox is getting started..."
108
- paths = File.new("#{GEMPATH}/../../log/new_path.log")
108
+ paths = File.new("#{gem_path}/../../log/new_path.log")
109
109
  home = "localhost:3002"
110
110
  sessions = search_sessions
111
111
  number_of_sessions = sessions.size
@@ -54,13 +54,13 @@ namespace :auto_test do
54
54
 
55
55
  desc 'stopping rails'
56
56
  task :stop do
57
- begin
58
- pid_file = 'tmp/pids/server.pid'
59
- pid = File.read(pid_file).to_i
60
- Process.kill 9, pid
61
- File.delete pid_file
62
- rescue
63
- end
57
+ begin
58
+ pid_file = 'tmp/pids/server.pid'
59
+ pid = File.read(pid_file).to_i
60
+ Process.kill 9, pid
61
+ File.delete pid_file
62
+ rescue
63
+ end
64
64
  end
65
65
 
66
66
  end
@@ -4,7 +4,10 @@ module AutoTest
4
4
  module Test
5
5
  module_function
6
6
 
7
- GEMPATH = %x(gem which auto_test)
7
+ def gem_path
8
+ path = %x(gem which auto_test)
9
+ path = path[0..path.size-13]
10
+ end
8
11
 
9
12
  # initialize all variables
10
13
  def initialize_test
@@ -298,7 +301,7 @@ module AutoTest
298
301
 
299
302
 
300
303
  def write_user_input_to_file
301
- f = File.new("#{GEMPATH}/../../log/user_input.log", "w")
304
+ f = File.new("#{gem_path}/../../log/user_input.log", "w")
302
305
  if Test.no_auth then
303
306
  f.puts("get_number_of_test_runs:#{get_number_of_test_runs}
304
307
  get_number_of_sessions:#{get_number_of_sessions}")
@@ -365,13 +368,13 @@ module AutoTest
365
368
  end
366
369
  Test.check_invariants
367
370
  if !Test.stop? then Test.users_logged_in = Test.users_logged_in + 1 end
368
- f = File.new("#{GEMPATH}/../../log/paths.log", "w")
371
+ f = File.new("#{gem_path}/../../log/paths.log", "w")
369
372
  f.puts(Test.action_path)
370
373
  f.close
371
374
  puts
372
375
  Error.print_errors
373
376
  if Error.get_error > 0 then
374
- f = File.new("#{GEMPATH}/../../log/errors.log", "w")
377
+ f = File.new("#{gem_path}/../../log/errors.log", "w")
375
378
  f.puts(Error.get_error)
376
379
  f.puts(Error.get_error_messages)
377
380
  f.close
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: auto_test
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.9.3.3
5
+ version: 0.0.9.3.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Maike Hargens