diff --git a/test/data/users-guide/example_address_book.rb b/test/data/users-guide/example_address_book.rb index ba8016a..7f0cd87 100644 --- a/test/data/users-guide/example_address_book.rb +++ b/test/data/users-guide/example_address_book.rb @@ -1,9 +1,10 @@ -require 'address_book' +require_relative 'address_book' require 'yaml' require 'pp' +require 'date' str = File.read('address_book.yaml') -ydoc = YAML.load(str) +ydoc = YAML.load(str, permitted_classes: [Date]) addrbook = AddressBook.new(ydoc) pp addrbook.groups diff --git a/test/data/users-guide/loadbabel.rb b/test/data/users-guide/loadbabel.rb index 3d38ad4..ef91e12 100644 --- a/test/data/users-guide/loadbabel.rb +++ b/test/data/users-guide/loadbabel.rb @@ -1,5 +1,5 @@ require 'kwalify' -require 'models' +require_relative 'models' ## load schema definition schema = Kwalify::Yaml.load_file('BABEL.schema.yaml', diff --git a/test/test-users-guide.rb b/test/test-users-guide.rb index e256149..7da5948 100644 --- a/test/test-users-guide.rb +++ b/test/test-users-guide.rb @@ -2,8 +2,9 @@ class UsersGuideTest < Test::Unit::TestCase - DATA_DIR = 'data/users-guide' + DATA_DIR = 'test/data/users-guide' CURR_DIR = Dir.pwd + puts "CURR DIR is #{CURR_DIR}" for item in Dir.glob("#{DATA_DIR}/*.result").sort() filename = File.basename(item) name = (filename =~ /(.*)\.\w+$/) && $1.gsub(/[^\w]/, '_')