Skip to content

Commit

Permalink
We don't actually serialize Proc objects, but we prevent a TypeError
Browse files Browse the repository at this point in the history
when an Example is passed to a remote Reporter.  This works for us
because the Reporter doesn't use the Example's Proc members.

Interestingly, this prevents us from using MRI on the client, because
only JRuby seems to allow me to define marshal_load (or self._load) so
that serialization of a Proc (no matter how implemented) is possible.
  • Loading branch information
jcrossley3 committed Jun 5, 2011
1 parent 063e951 commit 344d8f8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/torquespec/daemon.rb
Expand Up @@ -31,9 +31,8 @@ def stop
end

def run(name, reporter)
puts "JC: testing #{name}"
puts "JC: run #{name}"
example_group = @world.example_groups.find { |g| g.name == name }
puts "JC: found #{example_group}"
example_group.run( reporter )
end

Expand All @@ -58,3 +57,19 @@ def children
end
end
end

# We don't actually serialize Proc objects, but we prevent a TypeError
# when an object containing a Proc is serialized, e.g. when an Example
# is passed to a remote Reporter. This works for us because the
# Reporter doesn't use the Example's Proc objects.
class Proc
def marshal_dump
end
def marshal_load *args
end
def _dump *args
end
def self._load *args
new {}
end
end

0 comments on commit 344d8f8

Please sign in to comment.