drunit 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -2
- data/lib/drunit/remote_app.rb +15 -1
- data/test/unit/exception_handling_test.rb +1 -1
- data/test/unit/test_case_switching_test.rb +1 -1
- metadata +30 -12
- data/Rakefile +0 -45
- data/test/fake_app/fake_app.rb +0 -19
- data/test/test_helper.rb +0 -5
data/README.markdown
CHANGED
@@ -7,8 +7,8 @@ A library for running tests across multiple applications from a single test case
|
|
7
7
|
|
8
8
|
class MainTest < Test::Unit::TestCase
|
9
9
|
include Drunit
|
10
|
-
RemoteApp(:fake_app,
|
11
|
-
RemoteApp(:rails_app,
|
10
|
+
RemoteApp(:fake_app, 'fake_app.rb', FAKE_APP_PATH)
|
11
|
+
RemoteApp(:rails_app, 'script/runner', RAILS_APP_PATH)
|
12
12
|
|
13
13
|
def test_should_use_the_same_db
|
14
14
|
id = in_app(:fake_app){
|
data/lib/drunit/remote_app.rb
CHANGED
@@ -26,7 +26,9 @@ module Drunit
|
|
26
26
|
|
27
27
|
def start_app!
|
28
28
|
drb_server = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "bin", "drunit_remote"))
|
29
|
-
pipe = Dir.chdir(@dir)
|
29
|
+
pipe = Dir.chdir(@dir) do
|
30
|
+
with_clean_bundler_env{ IO.popen("#{drb_server} #{@boot}") }
|
31
|
+
end
|
30
32
|
|
31
33
|
at_exit {Process.kill('SIGTERM', pipe.pid)}
|
32
34
|
|
@@ -37,5 +39,17 @@ module Drunit
|
|
37
39
|
def app
|
38
40
|
@remote_object ||= start_app!
|
39
41
|
end
|
42
|
+
|
43
|
+
def with_clean_bundler_env
|
44
|
+
old_env = {}
|
45
|
+
%w[ BUNDLE_GEMFILE BUNDLE_BIN_PATH RUBYOPT ].each do |var|
|
46
|
+
old_env[var] = ENV.delete(var)
|
47
|
+
end
|
48
|
+
|
49
|
+
yield
|
50
|
+
|
51
|
+
ensure
|
52
|
+
old_env.each{ |var, value| ENV[var] = value }
|
53
|
+
end
|
40
54
|
end
|
41
55
|
end
|
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), *%w[.. test_helper])
|
|
2
2
|
|
3
3
|
class ExceptionHandlingTest < Test::Unit::TestCase
|
4
4
|
include Drunit
|
5
|
-
RemoteApp(:fake_app,
|
5
|
+
RemoteApp(:fake_app, "fake_app.rb", FAKE_APP_PATH)
|
6
6
|
def InApp(*args, &block)
|
7
7
|
in_app(:fake_app, *args, &block)
|
8
8
|
end
|
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), *%w[.. test_helper])
|
|
2
2
|
|
3
3
|
class SomeOtherTestCaseTest < Test::Unit::TestCase
|
4
4
|
include Drunit
|
5
|
-
RemoteApp(:fake_app,
|
5
|
+
RemoteApp(:fake_app, "fake_app.rb", FAKE_APP_PATH)
|
6
6
|
def InApp(*args, &block)
|
7
7
|
in_app(:fake_app, *args, &block)
|
8
8
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drunit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 11
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Tom Lea
|
@@ -14,10 +15,25 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
+
date: 2011-03-04 00:00:00 +00:00
|
18
19
|
default_executable:
|
19
|
-
dependencies:
|
20
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: ruby2ruby
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 19
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 1
|
33
|
+
- 0
|
34
|
+
version: 1.1.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
21
37
|
description: A library for running tests across multiple applications from a single test case.
|
22
38
|
email: commits@tomlea.co.uk
|
23
39
|
executables:
|
@@ -27,17 +43,15 @@ extensions: []
|
|
27
43
|
extra_rdoc_files:
|
28
44
|
- README.markdown
|
29
45
|
files:
|
30
|
-
- Rakefile
|
31
|
-
- README.markdown
|
32
46
|
- lib/drunit/remote_app.rb
|
33
47
|
- lib/drunit/remote_error.rb
|
34
48
|
- lib/drunit/remote_test.rb
|
35
49
|
- lib/drunit.rb
|
36
|
-
-
|
37
|
-
- test/test_helper.rb
|
50
|
+
- README.markdown
|
38
51
|
- test/unit/exception_handling_test.rb
|
39
52
|
- test/unit/main_test.rb
|
40
53
|
- test/unit/test_case_switching_test.rb
|
54
|
+
- bin/drunit_remote
|
41
55
|
has_rdoc: true
|
42
56
|
homepage:
|
43
57
|
licenses: []
|
@@ -51,23 +65,27 @@ rdoc_options:
|
|
51
65
|
require_paths:
|
52
66
|
- lib
|
53
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
54
69
|
requirements:
|
55
70
|
- - ">="
|
56
71
|
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
57
73
|
segments:
|
58
74
|
- 0
|
59
75
|
version: "0"
|
60
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
61
78
|
requirements:
|
62
79
|
- - ">="
|
63
80
|
- !ruby/object:Gem::Version
|
81
|
+
hash: 3
|
64
82
|
segments:
|
65
83
|
- 0
|
66
84
|
version: "0"
|
67
85
|
requirements: []
|
68
86
|
|
69
87
|
rubyforge_project:
|
70
|
-
rubygems_version: 1.
|
88
|
+
rubygems_version: 1.5.0
|
71
89
|
signing_key:
|
72
90
|
specification_version: 3
|
73
91
|
summary: A library for running tests across multiple applications from a single test case.
|
data/Rakefile
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rake/rdoctask'
|
5
|
-
require 'rake/gempackagetask'
|
6
|
-
require 'date'
|
7
|
-
|
8
|
-
desc 'Default: run unit tests.'
|
9
|
-
task :default => :test
|
10
|
-
|
11
|
-
desc 'run tests.'
|
12
|
-
Rake::TestTask.new(:test) do |t|
|
13
|
-
t.libs << 'lib'
|
14
|
-
t.pattern = 'test/**/*_test.rb'
|
15
|
-
t.verbose = true
|
16
|
-
end
|
17
|
-
|
18
|
-
spec = Gem::Specification.new do |s|
|
19
|
-
s.name = %q{drunit}
|
20
|
-
s.version = "0.4.3"
|
21
|
-
s.summary = %q{A library for running tests across multiple applications from a single test case.}
|
22
|
-
s.description = %q{A library for running tests across multiple applications from a single test case.}
|
23
|
-
|
24
|
-
s.files = FileList['[A-Z]*', 'lib/**/*.rb', 'test/**/*.rb', 'rails/*']
|
25
|
-
s.executables = "drunit_remote"
|
26
|
-
s.require_path = 'lib'
|
27
|
-
s.test_files = Dir[*['test/**/*_test.rb']]
|
28
|
-
|
29
|
-
s.has_rdoc = true
|
30
|
-
s.extra_rdoc_files = ["README.markdown"]
|
31
|
-
s.rdoc_options = ['--line-numbers', '--inline-source', "--main", "README.markdown"]
|
32
|
-
|
33
|
-
s.authors = ["Tom Lea"]
|
34
|
-
s.email = %q{commits@tomlea.co.uk}
|
35
|
-
|
36
|
-
s.platform = Gem::Platform::RUBY
|
37
|
-
end
|
38
|
-
|
39
|
-
Rake::GemPackageTask.new spec do |pkg|
|
40
|
-
pkg.need_tar = true
|
41
|
-
pkg.need_zip = true
|
42
|
-
end
|
43
|
-
|
44
|
-
desc "Clean files generated by rake tasks"
|
45
|
-
task :clobber => [:clobber_rdoc, :clobber_package]
|
data/test/fake_app/fake_app.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
class SomeFoo
|
2
|
-
def multiply(a,b)
|
3
|
-
a * b
|
4
|
-
end
|
5
|
-
end
|
6
|
-
|
7
|
-
class SomeException < Exception
|
8
|
-
end
|
9
|
-
|
10
|
-
class SomeOtherTestCase
|
11
|
-
def assert_in_new_test_case
|
12
|
-
add_assertion
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module MyModule
|
17
|
-
class SomeOtherException < Exception
|
18
|
-
end
|
19
|
-
end
|