Permalink
Browse files

Fix indentation in deparse.

Change-Id: Ic02cf42ae8f931f668d0c730984660b2e50f8ae2
  • Loading branch information...
1 parent 00a8946 commit 25ed8439bb64eb0969148f33b9750ec086c8e9e1 @kowshik kowshik committed Jul 31, 2012
Showing with 16 additions and 11 deletions.
  1. +1 −0 lib/membrane/schema_parser.rb
  2. +1 −1 lib/membrane/version.rb
  3. +14 −10 spec/schema_parser_spec.rb
@@ -153,6 +153,7 @@ def deparse_record(schema)
dep_key = key.inspect
end
+ dep_key = DEPARSE_INDENT + dep_key
dep_val_schema_lines = deparse(val_schema).split("\n")
dep_val_schema_lines.each_with_index do |line, line_idx|
View
@@ -1,3 +1,3 @@
module Membrane
- VERSION = "0.0.2"
+ VERSION = "0.0.3"
end
View
@@ -65,20 +65,24 @@
int_schema = Membrane::Schema::Class.new(Integer)
dict_schema = Membrane::Schema::Dictionary.new(str_schema, int_schema)
- int_rec_schema = Membrane::Schema::Record.new({:str => str_schema,
- :dict => dict_schema})
-
- rec_schema = Membrane::Schema::Record.new({"str" => str_schema,
+ int_rec_schema = Membrane::Schema::Record.new({
+ :str => str_schema,
+ :dict => dict_schema
+ })
+ rec_schema = Membrane::Schema::Record.new({
+ "str" => str_schema,
"rec" => int_rec_schema,
- "int" => int_schema})
+ "int" => int_schema
+ })
+
exp_deparse =<<EOT
{
-"str" => String,
-"rec" => {
- :str => String,
- :dict => dict(String, Integer),
+ "str" => String,
+ "rec" => {
+ :str => String,
+ :dict => dict(String, Integer),
},
-"int" => Integer,
+ "int" => Integer,
}
EOT
parser.deparse(rec_schema).should == exp_deparse.strip

0 comments on commit 25ed843

Please sign in to comment.