Sha256: 7e88ea3b76dc4cddf7a61ab05a21ba3159815551cff6b0bd3ee09d257c4bcd79

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'test/unit'
require 'luruju'
require 'fileutils'

class Test::Unit::TestCase 
  
  if am_i_jruby?
    java_class_path = java.lang.System.getProperty "java.class.path"
    jude_product = "community-5.0.2" if java_class_path.include? "Community"
    jude_product = "professional-5.1" if java_class_path.include? "Professional"
  else
    jude_product = "community-5.0.2"
  end
  
  TEST_JUDE_DIR = File.dirname(__FILE__) + '/jude/' + jude_product
  
  include Luruju
  
  @@test_jude_model_dir = {}

  def self.test_jude_model_dir(dir_sym) @@test_jude_model_dir[self] = dir_sym.to_s end
  
  def setup
    Luruju::Configuration.install
  end
  
  def teardown
    Luruju::Configuration.install
  end
  
  protected
  def jude_api_load jude_file, options={}
    jude_path = "#{jude_dir}/#{jude_file}.jude"
    Luruju::JudeApiLoader.load jude_path, options
  end
  
  def jude_dir()
    if @@test_jude_model_dir[self.class]
      "#{TEST_JUDE_DIR}/#{@@test_jude_model_dir[self.class]}"
    else
      File.dirname(__FILE__) + '/jude/'
    end
  end
  
end

class Object
  def jude_methods
    self.class.ancestors.inject(self.methods) do |result,item|
      result -= item.methods unless item.parent == Luruju::JudeApi
      result
    end.sort
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
luruju-0.2.0 test/abstract_unit.rb