cucumber_test_complete 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/cucumber_test_complete.rb +25 -23
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2EyYWNiYmM0YTg5MzkwMzZjNzE2NjcyMGVkMTJlNDBjN2JjYWJlOQ==
4
+ NTBmMGY4NjE3OWI4NGM5YWRmM2E4NmYxZmU1Yzc4OGU1ZDY1ZjY5ZA==
5
5
  data.tar.gz: !binary |-
6
- YjkyY2JmNGRiMWIyMjZmZjMzODBkOGRlZjI4OTM3MzM3MjA3YTk3ZQ==
6
+ YThkN2RlN2VjOTA0ZjYyNGZjMGFlNTQyZjc2YjUzMjZkODQ3Y2IxNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGYxZDE1MTgxN2M2OTlkZjAxYTU2ZTUxMjBkZjI3MDRhNWY0MjZiYzk2Yzg1
10
- ZTEyNjE0ODg1OWIwYTM2NzNiOTRiODY1OTFiOTdjMmZmOWNhNmE5MjA3Mzlj
11
- YjFhNjA1Zjg4MzhiOWVlZDI3NjhhN2EwNzk4NTA2ZGY3NDc4MGI=
9
+ N2YyZWExNmIyMDc4MWM1NGU3ZTc4ZjQ5NjA3NDQ0ZGQ1MjRkNmJmYzQwYWYy
10
+ ZDA5NjhhZmY1NmQ5OWRkZjZmZmYwNzQ1ODM5MzliYzNkYTc5ZTQ5ZmQ2Y2I3
11
+ YmExNzk5YzVjNWMyOTI1OWNiOWNjOWIyNTdhNGQ5MzVlNzA3MzA=
12
12
  data.tar.gz: !binary |-
13
- YjQ4ZmQ2ODM5ZjVjMGE4YWU2MTA2MGI2ZTBlMGFiYzc3YjY0NGUwYTVlMjc2
14
- YzRkYTk5MDg2YjViNzRkMWEwZTI3OWUxOTRiNWIyYWJjMzUwMzA0ZjIyMDI2
15
- ZWU3YzM5ZDhhNjY3ODU2YWM3OTg4OTI5Y2QyMmQwYWM1ZmQ1YWE=
13
+ MDQzNGNmNWZmNGIyNTlkODY4MGRlMGZmNzk3NWRhZDY4MWNiMzBjNWZjNjg5
14
+ MTk3MTA0YmViY2NiYzAzMzU5YWVhM2M4Y2NjNGJmYTBjZWRlY2FhMTMwZDkz
15
+ YmIyZTAwZDViMGQxODRiYmY0NmFjNTcxMDMxNDIzYjRhMDYwOTA=
@@ -2,35 +2,37 @@ require 'win32ole'
2
2
  require 'rspec-expectations'
3
3
 
4
4
  class TestCompleteWorld
5
- def initialize(test_complete_path, project_name, script_unit)
6
- @project_name = project_name
7
- @script_unit = script_unit
8
-
9
- puts 'Connecting to TestComplete'
10
- @test_complete = WIN32OLE.connect('TestComplete.TestCompleteApplication')
11
5
 
6
+ def initialize(test_complete_path, project_name)
7
+ @project_name = project_name
8
+
9
+ application_to_use = 'TestComplete.TestCompleteApplication'
10
+
12
11
  begin
13
- @test_complete.Integration
12
+ puts 'Connecting to TestExecute'
13
+ @test_execute = WIN32OLE.connect(application_to_use)
14
+ @test_execute.Integration
14
15
  rescue
15
- puts 'TestComplete does not appear to be running - starting instead'
16
- @test_complete = WIN32OLE.new('TestComplete.TestCompleteApplication')
16
+ puts 'TestExecute does not appear to be running - starting instead'
17
+ Thread.new {@test_execute = WIN32OLE.new(application_to_use)}
17
18
  end
18
-
19
- test_complete_path = File.expand_path(test_complete_path)
19
+
20
+ # dumb windows thing
21
+ test_complete_path = test_complete_path.gsub!('/', '\\')
20
22
 
21
23
  puts "Connected to TestComplete - making visible and opening project #{test_complete_path}"
22
24
 
23
- @test_complete.Visible = true
24
- @test_complete.Integration.OpenProjectSuite(test_complete_path)
25
+ @test_execute.Visible = true # works only with testcomplete
26
+ @test_execute.Integration.OpenProjectSuite(test_complete_path)
25
27
 
26
- @integration = @test_complete.Integration
28
+ @integration = @test_execute.Integration
27
29
  end
28
30
 
29
- def run_routine(name)
30
- puts "Running #{name} in project #{project_name}"
31
+ def run_routine(name,script_unit)
32
+ puts "Running #{name} in project #{@project_name}"
31
33
  begin
32
34
  run_with_delays do
33
- @integration.RunRoutine(@project_name, @script_unit, name)
35
+ @integration.RunRoutine(@project_name, script_unit, name)
34
36
  end
35
37
  rescue
36
38
  raise "Call to #{name} failed"
@@ -48,25 +50,25 @@ class TestCompleteWorld
48
50
  sleep 0.1
49
51
  end
50
52
 
51
- @test_complete.Integration.GetLastResultDescription.Status.should_not eq 2
53
+ @test_execute.Integration.GetLastResultDescription.Status.should_not eq 2
52
54
  end
53
55
 
54
- def run_routine_ex(name, *args)
56
+ def run_routine_ex(name, script_unit, args=[])
55
57
  puts "Running #{name} with arguments #{args} in project #{@project_name}"
56
58
  begin
57
59
  run_with_delays do
58
- @integration.RunRoutineEx(@project_name, @script_unit, name, args)
60
+ @integration.RunRoutineEx(@project_name, script_unit, name, args)
59
61
  end
60
62
  rescue
61
63
  raise "Call to #{name} with arguments #{args} failed"
62
64
  end
63
65
  end
64
66
 
65
- def call_script(name, *args)
67
+ def call_script(name, script_unit, *args)
66
68
  unless args.empty?
67
- run_routine_ex(name, args)
69
+ run_routine_ex(name,script_unit, args)
68
70
  else
69
- run_routine(name)
71
+ run_routine(name,script_unit)
70
72
  end
71
73
  end
72
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_test_complete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Holland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-15 00:00:00.000000000 Z
11
+ date: 2014-01-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem for integrating TestComplete into your Cucumber World
14
14
  email: NathanH@granicus.com