Sha256: d27f9dd53d8aaff787fda08e1dacaeac1843c97bbbf35fe33b8474d62da61900

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')
require 'scout/workflow'

class TestStepInfo < Test::Unit::TestCase
  def test_dependency
    TmpFile.with_file do |tmpdir|
      Path.setup(tmpdir)
      tmpfile = tmpdir.test_step
      step1 = Step.new tmpfile.step1, ["12"] do |s|
        s.length
      end

      assert_equal 2, step1.exec
      assert_equal 2, step1.run

      step2 = Step.new tmpfile.step2 do 
        step1 = dependencies.first
        step1.inputs.first + " has " + step1.load.to_s + " characters"
      end

      step2.dependencies = [step1]

      assert_equal "12 has 2 characters", step2.run
      assert_equal "12 has 2 characters", step2.run
    end
  end

  def test_inputs_marshal
    TmpFile.with_file do |tmpdir|
      Path.setup(tmpdir)
      tmpfile = tmpdir.test_step

      path = tmpfile.foo
      step1 = Step.new tmpfile.step1, [path] do |s|
        s.length
      end

      step1.run

      refute Path === step1.info[:inputs][0]

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
scout-gear-10.4.0 test/scout/workflow/step/test_info.rb
scout-gear-10.3.0 test/scout/workflow/step/test_info.rb
scout-gear-10.2.0 test/scout/workflow/step/test_info.rb
scout-gear-10.1.0 test/scout/workflow/step/test_info.rb
scout-gear-10.0.1 test/scout/workflow/step/test_info.rb
scout-gear-9.1.0 test/scout/workflow/step/test_info.rb
scout-gear-9.0.0 test/scout/workflow/step/test_info.rb