Sha256: 187ad16ada149da46f2fa6cb478cf74021730599a50423f6bbbdb5d2c936c8e4

Contents?: true

Size: 983 Bytes

Versions: 9

Compression:

Stored size: 983 Bytes

Contents

#
# testing ruote
#
# Wed Aug  5 08:35:38 JST 2009
#

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


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

  def test_load_definition

    pdef = %{
Ruote.process_definition :name => 'test' do
  sequence do
    echo 'a'
    echo 'b'
  end
end
    }

    path = File.join('work', 'tmp')
    fn = File.join(path, 'pdef.rb')

    FileUtils.mkdir_p(path)
    File.open(fn, 'w') { |f| f.write(pdef) }

    assert_equal(
      ["define", {"name"=>"test"}, [["sequence", {}, [["echo", {"a"=>nil}, []], ["echo", {"b"=>nil}, []]]]]],
      @engine.load_definition(fn))
  end

  def test_load_illegal_definition

    pdef = %{
Ruote.process_definition :name => 'test' do
  exit
end
    }

    path = File.join('work', 'tmp')
    fn = File.join(path, 'pdef.rb')

    FileUtils.mkdir_p(path)
    File.open(fn, 'w') { |f| f.write(pdef) }

    assert_raise ArgumentError do
      @engine.load_definition(fn)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruote-2.2.0 test/functional/ft_23_load_defs.rb
ruote-2.1.11 test/functional/ft_23_load_defs.rb
ruote-2.1.10 test/functional/ft_23_load_defs.rb
ruote-2.1.9 test/functional/ft_23_load_defs.rb
ruote-2.1.8 test/functional/ft_23_load_defs.rb
ruote-2.1.7 test/functional/ft_23_load_defs.rb
ruote-2.1.6 test/functional/ft_23_load_defs.rb
ruote-2.1.5 test/functional/ft_23_load_defs.rb
ruote-2.1.4 test/functional/ft_23_load_defs.rb