torquespec 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -1,2 +1,7 @@
1
1
  require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => :spec
@@ -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 run_examples(reporter)
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
- # We have no nested groups locally, only remotely
55
- def children
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
- # The way client-side specs are passed to the daemon
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
@@ -1,3 +1,3 @@
1
1
  module TorqueSpec
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
data/spec/remote_spec.rb CHANGED
@@ -20,5 +20,15 @@ remote_describe "in-container tests" do
20
20
  queue.stop
21
21
  end
22
22
 
23
+ context "nested example group" do
24
+ it "should work" do
25
+ true.should be_true
26
+ end
27
+
28
+ it "should also work" do
29
+ false.should be_false
30
+ end
31
+ end
32
+
23
33
  end
24
34
 
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 5
10
- version: 0.2.5
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-07 00:00:00 -04:00
19
+ date: 2011-06-08 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency