spec/dslh_spec.rb in dslh-0.3.7 vs spec/dslh_spec.rb in dslh-0.3.8
- old
+ new
@@ -2432,10 +2432,55 @@
end
end
EOS
end
+ it 'deval to hash from dsl that include empty array argument' do
+ dsl = <<-EOS
+glossary do
+ title "example glossary"
+ GlossDiv do
+ title "S"
+ GlossList do
+ GlossEntry do
+ ID "SGML"
+ SortAs "SGML"
+ GlossTerm "Standard Generalized Markup Language"
+ Acronym "SGML"
+ Abbrev "ISO 8879:1986"
+ GlossDef do
+ para "A meta-markup language, used to create markup languages such as DocBook."
+ GlossSeeAlso []
+ end
+ GlossSee "markup"
+ end
+ end
+ end
+end
+ EOS
+
+ h = Dslh.eval(dsl)
+ expect(h).to eq(
+ {"glossary"=>
+ {"title"=>"example glossary",
+ "GlossDiv"=>
+ {"title"=>"S",
+ "GlossList"=>
+ {"GlossEntry"=>
+ {"ID"=>"SGML",
+ "SortAs"=>"SGML",
+ "GlossTerm"=>"Standard Generalized Markup Language",
+ "Acronym"=>"SGML",
+ "Abbrev"=>"ISO 8879:1986",
+ "GlossDef"=>
+ {"para"=>
+ "A meta-markup language, used to create markup languages such as DocBook.",
+ "GlossSeeAlso"=>[]},
+ "GlossSee"=>"markup"}}}}}
+ )
+ end
+
it 'should be hash that include empty array' do
h = {"glossary"=>
{"title"=>"example glossary",
"GlossDiv"=>
{"title"=>"S",
@@ -2463,13 +2508,13 @@
ID "SGML"
SortAs "SGML"
GlossTerm "Standard Generalized Markup Language"
Acronym "SGML"
Abbrev "ISO 8879:1986"
- GlossDef(
- {"para"=>
- "A meta-markup language, used to create markup languages such as DocBook.",
- "GlossSeeAlso"=>[]})
+ GlossDef do
+ para "A meta-markup language, used to create markup languages such as DocBook."
+ GlossSeeAlso []
+ end
GlossSee "markup"
end
end
end
end