dc-kwalify 0.7.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/contrib/kwalify +1 -1
- data/dc-kwalify.gemspec +27 -0
- data/lib/kwalify/main.rb +1 -1
- data/lib/kwalify/util/testcase-helper.rb +1 -1
- data/lib/kwalify/version.rb +5 -0
- data/lib/kwalify.rb +1 -7
- metadata +83 -203
- data/setup.rb +0 -1585
- data/test/Rookbook.yaml +0 -10
- data/test/data/users-guide/AddressBook.java.expected +0 -40
- data/test/data/users-guide/BABEL.data.yaml +0 -24
- data/test/data/users-guide/BABEL.schema.yaml +0 -30
- data/test/data/users-guide/ExampleAddressBook.java +0 -47
- data/test/data/users-guide/Group.java.expected +0 -24
- data/test/data/users-guide/Person.java.expected +0 -44
- data/test/data/users-guide/address_book.rb +0 -52
- data/test/data/users-guide/address_book.schema.yaml +0 -28
- data/test/data/users-guide/address_book.yaml +0 -27
- data/test/data/users-guide/answers-schema.yaml +0 -12
- data/test/data/users-guide/answers-validator.rb +0 -52
- data/test/data/users-guide/babel_genclass.result +0 -26
- data/test/data/users-guide/config.schema.yaml +0 -7
- data/test/data/users-guide/config.yaml +0 -4
- data/test/data/users-guide/document01a.yaml +0 -3
- data/test/data/users-guide/document01b.yaml +0 -3
- data/test/data/users-guide/document02a.yaml +0 -4
- data/test/data/users-guide/document02b.yaml +0 -4
- data/test/data/users-guide/document03a.yaml +0 -6
- data/test/data/users-guide/document03b.yaml +0 -6
- data/test/data/users-guide/document04a.yaml +0 -9
- data/test/data/users-guide/document04b.yaml +0 -9
- data/test/data/users-guide/document05a.yaml +0 -11
- data/test/data/users-guide/document05b.yaml +0 -12
- data/test/data/users-guide/document06a.yaml +0 -15
- data/test/data/users-guide/document06b.yaml +0 -16
- data/test/data/users-guide/document07a.yaml +0 -9
- data/test/data/users-guide/document07b.yaml +0 -7
- data/test/data/users-guide/document12a.json +0 -10
- data/test/data/users-guide/document12b.json +0 -6
- data/test/data/users-guide/document13a.yaml +0 -17
- data/test/data/users-guide/document14a.yaml +0 -3
- data/test/data/users-guide/document14b.yaml +0 -3
- data/test/data/users-guide/document15a.yaml +0 -6
- data/test/data/users-guide/document15b.yaml +0 -5
- data/test/data/users-guide/example_address_book.rb +0 -10
- data/test/data/users-guide/example_address_book_java.result +0 -32
- data/test/data/users-guide/example_address_book_ruby.result +0 -31
- data/test/data/users-guide/genclass_java.result +0 -4
- data/test/data/users-guide/howto-validation-with-parsing.rb +0 -28
- data/test/data/users-guide/howto-validation.rb +0 -25
- data/test/data/users-guide/howto3.rb +0 -6
- data/test/data/users-guide/howto3.result +0 -5
- data/test/data/users-guide/howto3.yaml +0 -8
- data/test/data/users-guide/howto5_databinding.result +0 -111
- data/test/data/users-guide/invalid01.result +0 -3
- data/test/data/users-guide/invalid02.result +0 -5
- data/test/data/users-guide/invalid03.result +0 -5
- data/test/data/users-guide/invalid04.result +0 -4
- data/test/data/users-guide/invalid05.result +0 -11
- data/test/data/users-guide/invalid06.result +0 -4
- data/test/data/users-guide/invalid07.result +0 -3
- data/test/data/users-guide/invalid08.result +0 -3
- data/test/data/users-guide/invalid12.json +0 -8
- data/test/data/users-guide/invalid14.result +0 -4
- data/test/data/users-guide/invalid15.result +0 -4
- data/test/data/users-guide/loadbabel.rb +0 -27
- data/test/data/users-guide/loadconfig.rb +0 -16
- data/test/data/users-guide/loadconfig.result +0 -6
- data/test/data/users-guide/models.rb +0 -22
- data/test/data/users-guide/option_ha.result +0 -6
- data/test/data/users-guide/option_ha_genclass_java.result +0 -7
- data/test/data/users-guide/schema01.yaml +0 -3
- data/test/data/users-guide/schema02.yaml +0 -12
- data/test/data/users-guide/schema03.yaml +0 -9
- data/test/data/users-guide/schema04.yaml +0 -20
- data/test/data/users-guide/schema05.yaml +0 -29
- data/test/data/users-guide/schema06.yaml +0 -11
- data/test/data/users-guide/schema12.json +0 -12
- data/test/data/users-guide/schema13.yaml +0 -13
- data/test/data/users-guide/schema14.yaml +0 -5
- data/test/data/users-guide/schema15.yaml +0 -21
- data/test/data/users-guide/valid01.result +0 -2
- data/test/data/users-guide/valid02.result +0 -2
- data/test/data/users-guide/valid03.result +0 -2
- data/test/data/users-guide/valid04.result +0 -2
- data/test/data/users-guide/valid05.result +0 -2
- data/test/data/users-guide/valid06.result +0 -2
- data/test/data/users-guide/valid07.result +0 -2
- data/test/data/users-guide/valid08.result +0 -2
- data/test/data/users-guide/valid12.result +0 -2
- data/test/data/users-guide/valid13.result +0 -2
- data/test/data/users-guide/valid14.result +0 -2
- data/test/data/users-guide/valid15.result +0 -2
- data/test/data/users-guide/validate08.rb +0 -37
- data/test/test-action.rb +0 -78
- data/test/test-action.yaml +0 -738
- data/test/test-databinding.rb +0 -83
- data/test/test-databinding.yaml +0 -339
- data/test/test-main.rb +0 -157
- data/test/test-main.yaml +0 -415
- data/test/test-metavalidator.rb +0 -80
- data/test/test-metavalidator.yaml +0 -1179
- data/test/test-parser-yaml.rb +0 -57
- data/test/test-parser-yaml.yaml +0 -1749
- data/test/test-rule.rb +0 -26
- data/test/test-rule.yaml +0 -317
- data/test/test-users-guide.rb +0 -75
- data/test/test-util.rb +0 -125
- data/test/test-validator.rb +0 -95
- data/test/test-validator.yaml +0 -986
- data/test/test-yaml-parser.rb +0 -47
- data/test/test-yaml-parser.yaml +0 -1226
- data/test/test.rb +0 -61
data/test/test-parser-yaml.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
###
|
2
|
-
### $Rev$
|
3
|
-
### $Release: 0.7.2 $
|
4
|
-
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
5
|
-
###
|
6
|
-
|
7
|
-
require File.dirname(__FILE__) + '/test.rb'
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
class YamlParserTest < Test::Unit::TestCase
|
12
|
-
|
13
|
-
filename = __FILE__.sub(/\.rb$/, '.yaml')
|
14
|
-
load_yaml_testdata(filename, :lang=>'ruby')
|
15
|
-
|
16
|
-
def _test()
|
17
|
-
if @exception
|
18
|
-
@error_class = @exception.split(/::/).inject(Kernel) { |c,s| c = c.const_get(s) }
|
19
|
-
end
|
20
|
-
parser = Kwalify::Yaml::Parser.new()
|
21
|
-
@testopts ||= {}
|
22
|
-
parser.preceding_alias = true if @testopts['preceding_alias']
|
23
|
-
if @error_class
|
24
|
-
ex = assert_raise(@error_class) do
|
25
|
-
doc = parser.parse(@input)
|
26
|
-
end
|
27
|
-
else
|
28
|
-
doc = parser.parse(@input)
|
29
|
-
if @testopts['pp'] || @testopts['recursive']
|
30
|
-
s = StringWriter.new
|
31
|
-
PP.pp(doc, s)
|
32
|
-
actual = s
|
33
|
-
else
|
34
|
-
actual = doc.inspect + "\n"
|
35
|
-
end
|
36
|
-
if $log
|
37
|
-
File.open("#{@name}.expected", 'w') { |f| f.write(@expected) }
|
38
|
-
File.open("#{@name}.actual", 'w') { |f| f.write(actual) }
|
39
|
-
end
|
40
|
-
if $print
|
41
|
-
print actual
|
42
|
-
else
|
43
|
-
assert_text_equal(@expected, actual)
|
44
|
-
#t = parser.instance_variable_get("@location_table")
|
45
|
-
#require 'pp'
|
46
|
-
if @locations
|
47
|
-
@locations.each do |path, expected_linenum, expected_column|
|
48
|
-
linenum, column = parser.location(path)
|
49
|
-
assert_equal(expected_linenum, linenum)
|
50
|
-
assert_equal(expected_column, column)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|