source: ruby/trunk/lib/adl_parser/test/remote_adl_test.rb@ 318

Last change on this file since 318 was 318, checked in by Tatsukawa, Akimichi, 15 years ago

successfully parsing all the adl files under http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr directory

File size: 828 bytes
Line 
1require File.dirname(__FILE__) + '/test_helper.rb'
2
3class RemoteADLTest < Test::Unit::TestCase
4 def setup
5 @adls = []
6 dirs = ["cluster/", "composition/", "element/", "entry/", "section/", "structure/"]
7 dirs.each do |dir|
8 doc = Hpricot( open("http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}").read )
9 (doc/:a).each do |link|
10 if link[:href] =~ /.*\.adl\Z/
11 @adls << "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}#{$~}"
12 end
13 end
14 end
15 @parser = ::OpenEhr::ADL::Parser.new
16 end
17
18 must "adls should properly parsed" do
19 assert_nothing_raised do
20 @adls.each do |adl|
21 puts "Processing #{adl}"
22 open(adl) do |file|
23 @parser.parse(file.read, adl)
24 end
25 end
26 end
27 end
28
29end
Note: See TracBrowser for help on using the repository browser.