Class Uttk::Strategies::Command
In: lib/uttk/strategies/Command.rb
Parent: Strategy

I can check many interaction with a command line based program, such as: its standard output, exit status, standard error. I can specify to a given command its arguments, environment variables and standard input.

A tutorial introduces how to use this strategy at uttk.org/shelf/documentation

Methods

Included Modules

Concrete

Attributes

my_data  [R]  Contains the OCmd::Datas::Data object, the result of the command running.
runner  [RW]  The OCmd::Runners::Runner used to run the command.

Public Instance methods

Methods

[Source]

# File lib/uttk/strategies/Command.rb, line 24
      def prologue
        super
        @runner = mk_system_runner @env
        @command = @command.to_ocmd
        @command += @args.to_ocmd_args
        @command.dir = @dir
        @command.input = @input
      end

Protected Instance methods

[Source]

# File lib/uttk/strategies/Command.rb, line 50
      def abort_hook
        @runner.abort @my_data if @runner and defined? @my_data
        super
      end

[Source]

# File lib/uttk/strategies/Command.rb, line 40
      def assertion
        assert_cmd @matcher, @my_data,
                   :output => @output,
                   :error  => @error,
                   :exit   => @exit
        pass
      end

[Source]

# File lib/uttk/strategies/Command.rb, line 57
      def epilogue
        @my_data.clean if defined? @my_data
        super
      end

[Source]

# File lib/uttk/strategies/Command.rb, line 34
      def run_impl
        @my_data = @command.run @runner
      end

[Validate]