Sha256: 2427c28cae0c96da7729200d5aef7dd0e21e5c3b60e32716db8ea3536b980c59

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

$:.unshift File.join(File.dirname(__FILE__),'..','..','lib')

require 'test/unit'
require 'ivy/targets'
require 'ivy4r'

module Ivy
  class TargetsTest < Test::Unit::TestCase

    def setup
      ivy4r = Ivy4r.new
      ivy4r.ant_home = File.join(File.dirname(__FILE__), '..', '..', 'jars')
      ivy4r.lib_dir = ivy4r.ant_home
      @ivy_test_xml = File.join(File.dirname(__FILE__), 'ivytest.xml')
      @info = Ivy::Info.new(ivy4r.ant)
    end

    def test_execute_empty_parameters_missing_mandatory_exception
      assert_raise(ArgumentError) { @info.execute({}) }
    end

    def test_execute_validate_with_unkown_parameter_exception
      assert_raise(ArgumentError) { @info.execute(:unknown_parameter => 'unknown') }
    end

    def test_execute_simple_file_correct_return_values
      result = @info.execute(:file => @ivy_test_xml)

      assert_not_nil result
      %w[ivy.organisation ivy.revision ivy.module].each do |var|
        assert_equal true, result.keys.member?(var), "Contains key '#{var}', has '#{result.keys.join(', ')}'"
      end
      assert_equal 'blau', result['ivy.organisation']
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
klaas1979-ivy4r-0.1.0 test/ivy/test_targets.rb
klaas1979-ivy4r-0.2.0 test/ivy/test_targets.rb
klaas1979-ivy4r-0.3.0 test/ivy/test_targets.rb
klaas1979-ivy4r-0.4.0 test/ivy/test_targets.rb
klaas1979-ivy4r-0.5.0 test/ivy/test_targets.rb
ivy4r-0.2.0 test/ivy/test_targets.rb
ivy4r-0.3.0 test/ivy/test_targets.rb