Sha256: ea8215c73695b431464449539887bba9663586f0bd60ecd51f590b9dfb6f0bf6

Contents?: true

Size: 1018 Bytes

Versions: 2

Compression:

Stored size: 1018 Bytes

Contents

#
# testing ruote
#
# Thu Dec  9 16:39:54 JST 2010
#

require 'stringio'
require File.join(File.dirname(__FILE__), 'base')


class FtMiscTest < Test::Unit::TestCase
  include FunctionalBase

  def test_noisy

    result = String.new
    out = StringIO.new(result, 'w+')

    prev = $stdout
    $stdout = out

    @engine.noisy = true

    wfid = @engine.launch(Ruote.define do
      echo 'nada'
    end)

    @engine.wait_for(wfid)

    out.close
    $stdout = prev

    assert_not_nil result
  end

  class NoCancel
    def consume(workitem)
      # do nothing
    end
    # no cancel method implementation
  end

  def test_participant_missing_cancel_method

    pdef = Ruote.define do
      participant 'no_cancel'
    end

    @engine.register 'no_cancel', NoCancel

    #noisy

    wfid = @engine.launch(pdef)

    @engine.wait_for(:no_cancel)

    @engine.cancel(wfid)

    @engine.wait_for(wfid)

    assert_match(
      /undefined method `cancel' for/,
      @engine.ps(wfid).errors.first.message)
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/functional/ft_51_misc.rb
ruote-2.2.0 test/functional/ft_51_misc.rb