torquespec 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -0
- data/lib/torquespec/daemon.rb +25 -9
- data/lib/torquespec/torquespec.rb +11 -1
- data/lib/torquespec/version.rb +1 -1
- data/spec/remote_spec.rb +10 -0
- metadata +4 -4
data/Rakefile
CHANGED
data/lib/torquespec/daemon.rb
CHANGED
@@ -39,10 +39,21 @@ module TorqueSpec
|
|
39
39
|
|
40
40
|
# Intended to extend an RSpec::Core::ExampleGroup
|
41
41
|
module Client
|
42
|
+
|
43
|
+
def run(reporter)
|
44
|
+
begin
|
45
|
+
eval_before_alls(new)
|
46
|
+
run_remotely(reporter)
|
47
|
+
ensure
|
48
|
+
eval_after_alls(new)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
42
52
|
# Delegate all examples (and nested groups) to remote daemon
|
43
|
-
def
|
53
|
+
def run_remotely(reporter)
|
44
54
|
DRb.start_service("druby://127.0.0.1:0")
|
45
55
|
daemon = DRbObject.new_with_uri("druby://127.0.0.1:#{TorqueSpec.drb_port}")
|
56
|
+
# TODO: maybe fall back to local if can't run?
|
46
57
|
begin
|
47
58
|
daemon.run( name, reporter )
|
48
59
|
rescue Exception
|
@@ -51,9 +62,19 @@ module TorqueSpec
|
|
51
62
|
DRb.stop_service
|
52
63
|
end
|
53
64
|
end
|
54
|
-
|
55
|
-
|
56
|
-
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
module RSpec
|
71
|
+
module Core
|
72
|
+
class Example
|
73
|
+
def marshal_dump
|
74
|
+
@metadata
|
75
|
+
end
|
76
|
+
def marshal_load metadata
|
77
|
+
@metadata = metadata
|
57
78
|
end
|
58
79
|
end
|
59
80
|
end
|
@@ -68,9 +89,4 @@ class Proc
|
|
68
89
|
end
|
69
90
|
def marshal_load *args
|
70
91
|
end
|
71
|
-
def _dump *args
|
72
|
-
end
|
73
|
-
def self._load *args
|
74
|
-
new {}
|
75
|
-
end
|
76
92
|
end
|
@@ -30,10 +30,20 @@ module TorqueSpec
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# A somewhat hackish way of exposing client-side gems to the server-side daemon
|
33
|
+
#
|
34
|
+
# TODO: Fix it so I don't include old versions of TorqueSpec
|
35
|
+
#
|
33
36
|
def self.rubylib
|
34
37
|
Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), "../../..", "*{spec,diff-lcs}*/lib"))).join(":")
|
35
38
|
end
|
36
|
-
|
39
|
+
|
40
|
+
# The way client-side specs are passed to the daemon
|
41
|
+
#
|
42
|
+
# TODO: This won't work because we need to pass ARGV to the daemon,
|
43
|
+
# and we can't just map its items to their expanded path, e.g. -l
|
44
|
+
# 42, so we must pass (ARGV || spec) and Dir.pwd so that the daemon
|
45
|
+
# may initialize itself within that directory.
|
46
|
+
#
|
37
47
|
def self.specs
|
38
48
|
RSpec::configuration.files_to_run.map {|f| File.expand_path(f) }.inspect
|
39
49
|
end
|
data/lib/torquespec/version.rb
CHANGED
data/spec/remote_spec.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torquespec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jim Crossley
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-06-
|
19
|
+
date: 2011-06-08 00:00:00 -04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|