Sha256: e5f9c78d3f3b52d4c3b8709cab72b1b82fc27ed1b6d357c1880e557080871ff7

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

require 'test/unit'
require 'como'
include Como
require 'stringio'


# Test execution routine.
def runTest( test )
    Dir.chdir( 'test' )
    FileUtils.mkdir_p "result"
    rf = "result/#{test}.txt"
    gf = "golden/#{test}.txt"

    system( "rm -f #{rf}; touch #{rf}" )

    File.open( "test_#{test}" ).readlines.each do |cmd|
        cmd = cmd.chomp
        next if cmd.empty?
        system( "echo \"---- CMD: #{cmd}\" >> #{rf}" )
        system( "export RUBYLIB=../lib; #{cmd} >> #{rf} 2>&1" )
    end

    if false
    # if true
        # Populate golden files after inspection.
        system( "cp #{rf} #{gf}" )
    end

    assert( system( "diff #{rf} #{gf}" ), "FAILED: diff #{rf} #{gf}" )

    Dir.chdir( '..' )
end


class ComoTest < Test::Unit::TestCase

    def test_options()       runTest( "options"       ); end
    def test_queries()       runTest( "queries"       ); end
    def test_config()        runTest( "config"        ); end
    def test_rule_1()        runTest( "rule_1"        ); end
    def test_rule_2()        runTest( "rule_2"        ); end
    def test_subcmd()        runTest( "subcmd"        ); end
    def test_subcmd_rule()   runTest( "subcmd_rule"   ); end
    def test_subcmd_config() runTest( "subcmd_config" ); end
    def test_compatible()    runTest( "compatible"    ); end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
como-0.1.7 test/test_como.rb
como-0.1.6 test/test_como.rb
como-0.1.5 test/test_como.rb
como-0.1.4 test/test_como.rb
como-0.1.3 test/test_como.rb
como-0.1.2 test/test_como.rb