Sha256: 1baced25ee79509e2035e6df810040b5cbf80afab6e08c2301cf34e61a404ed8

Contents?: true

Size: 1.65 KB

Versions: 11

Compression:

Stored size: 1.65 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Tue Jan  2 13:14:37 JST 2007
#

require 'flowtestbase'
require 'openwfe/expool/history'
require 'openwfe/expressions/raw_prog'

include OpenWFE


class FlowTest22 < Test::Unit::TestCase
    include FlowTestBase

    #def setup
    #end

    #def teardown
    #end

    #
    # Test 0
    #

    class TestDefinition0 < ProcessDefinition
        def make
            process_definition :name => "test0", :revision => "0" do
                sequence do
                    _print "a"
                    _print "b"
                    _print "c"
                end
            end
        end
    end

    def test_history_0

        @engine.init_service("history", InMemoryHistory)

        history = @engine.application_context["history"]

        dotest(
            TestDefinition0,
            """a
b
c""")

        #puts history.to_s
        #puts history.entries.size()

        #f = File.open("history.log", "w")
        #f.write(history.to_s)
        #f.close()

        #assert \
        #    (history.entries.size == 36),
        #    "invalid history count : #{history.entries.size}"
        assert \
            history.entries.size == 22,
            "invalid history count : #{history.entries.size}"
    end

    def test_history_1

        @engine.init_service("history", FileHistory)

        dotest(
            TestDefinition0,
            """a
b
c""")

        @engine.ac["history"].output_file.flush

        linecount = File.open("work/history.log") do |f|
            f.readlines.size
        end

        assert \
            linecount == 22,
            "invalid history count : #{linecount}"
    end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
openwferu-0.9.10 test/ft_22_history.rb
openwferu-0.9.10.653 test/ft_22_history.rb
openwferu-0.9.11 test/ft_22_history.rb
openwferu-0.9.12 test/ft_22_history.rb
openwferu-0.9.12.863 test/ft_22_history.rb
openwferu-0.9.13 test/ft_22_history.rb
openwferu-0.9.14 test/ft_22_history.rb
openwferu-0.9.15 test/ft_22_history.rb
openwferu-0.9.16 test/ft_22_history.rb
openwferu-0.9.8 test/ft_22_history.rb
openwferu-0.9.9 test/ft_22_history.rb