cucumber_test_complete 0.1.1

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 +15 -0
  2. data/lib/test_complete_world.rb +73 -0
  3. metadata +47 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZGY3NGI4ZTkxYmZjNjk1NmUwZjU5N2RhODJjYmQ2NTE4Yjg5NDhjNA==
5
+ data.tar.gz: !binary |-
6
+ OTkwNDA0OWRhN2ExNTc1YjU5NTJiZDQ4NGEyMjYzM2E0MmI5ODUyYg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OTg4MGNhNDQyOGIzOGM0ZjYzZWNiOWUzNWFiNWIyZDgyYWY5ZTFjMjE1YmFm
10
+ ZDE0M2I1MGI4MmM4ZDM5ZDlmZTgwMzAwMjEzNGZhODMzZmU4Y2NjNDU1MzE4
11
+ YzA2MWUyZGY0NzMyOGQwY2E2MGIxNWE3OTk3MGExOTcxODI2N2E=
12
+ data.tar.gz: !binary |-
13
+ OTg1Zjg2OGRkMmVlMDg5MGM1ODU0NDcyZGJhN2I3MDQxYWQ3OGM3NzQwM2Q2
14
+ MGVlZjJjMWEzMTU1N2E2YmExMzUxY2QyNjAyYjRiMmUzN2U1YzA3YjAwYzQ1
15
+ M2YxY2M3NjYwMTNlYTVmMzU4NTE0ZGQzZTFiYmE5MWY4ZTQyZjU=
@@ -0,0 +1,73 @@
1
+ require 'win32ole'
2
+ require 'rspec-expectations'
3
+
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
+
12
+ begin
13
+ @test_complete.Integration
14
+ rescue
15
+ puts 'TestComplete does not appear to be running - starting instead'
16
+ @test_complete = WIN32OLE.new('TestComplete.TestCompleteApplication')
17
+ end
18
+
19
+ file = File.new(@test_complete_path)
20
+ @test_complete_path = file.path
21
+
22
+ puts "Connected to TestComplete - making visible and opening project #{@test_complete_path}"
23
+
24
+ @test_complete.Visible = true
25
+ @test_complete.Integration.OpenProjectSuite(@test_complete_path)
26
+
27
+ @integration = @test_complete.Integration
28
+ end
29
+
30
+ def run_routine(name)
31
+ puts "Running #{name} in project #{project_name}"
32
+ begin
33
+ run_with_delays do
34
+ @integration.RunRoutine(@project_name, @script_unit, name)
35
+ end
36
+ rescue
37
+ raise "Call to #{name} failed"
38
+ end
39
+ end
40
+
41
+ def run_with_delays
42
+ while @integration.IsRunning
43
+ sleep 0.1
44
+ end
45
+
46
+ yield
47
+
48
+ while @integration.IsRunning
49
+ sleep 0.1
50
+ end
51
+
52
+ @test_complete.Integration.GetLastResultDescription.Status.should_not eq 2
53
+ end
54
+
55
+ def run_routine_ex(name, *args=[])
56
+ puts "Running #{name} with arguments #{args} in project #{@project_name}"
57
+ begin
58
+ run_with_delays do
59
+ @integration.RunRoutineEx(@project_name, @script_unit, name, args)
60
+ end
61
+ rescue
62
+ raise "Call to #{name} with arguments #{args} failed"
63
+ end
64
+ end
65
+
66
+ def call_script(name, *args=[])
67
+ unless args.empty?
68
+ run_routine_ex(name, args)
69
+ else
70
+ run_routine(name)
71
+ end
72
+ end
73
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cucumber_test_complete
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Nathan Holland
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A gem for integrating TestComplete into your Cucumber World
14
+ email: NathanH@granicus.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/test_complete_world.rb
20
+ homepage: http://rubygems.org/gems/cucumber_test_complete
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements:
39
+ - win32ole
40
+ - rspec-expectations
41
+ rubyforge_project:
42
+ rubygems_version: 2.1.11
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Test Complete for Cucumber
46
+ test_files: []
47
+ has_rdoc: