1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
Index: kwalify/test/test-users-guide.rb
===================================================================
--- kwalify.orig/test/test-users-guide.rb
+++ kwalify/test/test-users-guide.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__
class UsersGuideTest < Test::Unit::TestCase
- DATA_DIR = 'data/users-guide'
+ DATA_DIR = File.join(TESTDIR, 'data', 'users-guide')
CURR_DIR = Dir.pwd
for item in Dir.glob("#{DATA_DIR}/*.result").sort()
filename = File.basename(item)
@@ -24,7 +24,7 @@ class UsersGuideTest < Test::Unit::TestC
_test()
end
def test_example_address_book_ruby
- @command = 'ruby example_address_book.rb'
+ @command = 'ruby -I. example_address_book.rb'
@result = File.read('example_address_book_ruby.result')
@testopts = { 'delete_object_id' => true }
_test()
Index: kwalify/test/test.rb
===================================================================
--- kwalify.orig/test/test.rb
+++ kwalify/test/test.rb
@@ -5,10 +5,14 @@
###
unless defined?(TESTDIR)
- TESTDIR = File.dirname(__FILE__)
- #libdir = TESTDIR == '.' ? '../lib' : File.dirname(TESTDIR) + "/lib"
- libdir = TESTDIR == '.' ? File.expand_path('../lib') : File.dirname(TESTDIR) + "/lib"
- $LOAD_PATH << libdir << TESTDIR
+ TESTDIR = File.expand_path(File.dirname(__FILE__))
+ $LOAD_PATH.unshift TESTDIR
+ libdir = File.expand_path(File.join(TESTDIR, "..", "lib"))
+ $LOAD_PATH.unshift libdir
+ # kwalify commands are exec-ed in the tests
+ ENV['RUBYLIB'] = libdir
+ bindir = File.expand_path(File.join(TESTDIR, "..", "bin"))
+ ENV['PATH'] = bindir + ":" + ENV['PATH']
end
Index: kwalify/test/data/users-guide/howto5_databinding.result
===================================================================
--- kwalify.orig/test/data/users-guide/howto5_databinding.result
+++ kwalify/test/data/users-guide/howto5_databinding.result
@@ -1,4 +1,4 @@
-$ ruby loadbabel.rb
+$ ruby -I. loadbabel.rb
{"teams"=>
[#<Babel::Team:0x53e0f8
@chief=
|