Sha256: cb119de13b2d24c08b08276a34c5a1063c65d711b9ea49c98e30f6d9c8c9b02e

Contents?: true

Size: 996 Bytes

Versions: 1

Compression:

Stored size: 996 Bytes

Contents

# Author::    Nicolas Pouillard  <ertai@lrde.epita.fr>.
# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
# License::   GNU General Public License (GPL).
# Revision::  $Id: exec.rb 221 2005-05-09 12:40:57Z ertai $

module Commands

  module Runners

    class Exec < Runner
      concrete

      def exec ( aCommand, data )
        Kernel.exec(*aCommand.to_a)
      end

    end # class Exec



    if $0 == __FILE__
      require 'test/unit'

      class ExecTest < Test::Unit::TestCase

        def setup
          assert_nothing_raised { @runner = Exec.new }
        end

        def test_0_initialize
        end

        def test_simple
          TempPath.new do |tmp|
            cmd = %Q[ruby -e "File.open('#{tmp}', 'w') { |f| f.puts :foo }"]
            pid = fork do
              @runner.run(cmd.to_cmd)
            end
            Process.waitpid pid
          end
        end

      end # class ExecTest

    end

  end # module Runners

end # module Commands

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vcs-0.2.148 ruby_ex/commands/runners/exec.rb