Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use Marshal instead of inspect.

Object#inspect is not a method to dump.
  • Loading branch information...
commit a9cb7517d9d805371a47e3fbc5d500ea6301f35a 1 parent ffb634f
@nurse nurse authored
View
12 core/process/fixtures/common.rb
@@ -18,13 +18,11 @@ def wait_for_daemon
end
def invoke(behavior, arguments=[])
- case arguments.size
- when 0, 1
- args = arguments.inspect
- when 2
- args = "[#{arguments.first.inspect},#{arguments.last.inspect}]"
- end
- args << " #{@input} #{@data} #{@signal} #{behavior}"
+ args = Marshal.dump(arguments).unpack("H*")
+ args << @input
+ args << @data
+ args << @signal
+ args << behavior
ruby_exe @script, :args => args
View
2  core/process/fixtures/daemon.rb
@@ -2,7 +2,7 @@ module ProcessSpecs
class Daemon
def initialize(argv)
args, @input, @data, @signal, @behavior = argv
- @args = eval args
+ @args = Marshal.load [args].pack("H*")
@no_at_exit = false
end
Please sign in to comment.
Something went wrong with that request. Please try again.