Permalink
Browse files

Pretty printer for bool schemas

Change-Id: I110c4a107deec76fcf60862c6e351ef7e366a425
  • Loading branch information...
1 parent 0e7afb3 commit f72d2ab193d3935c2f9b4a2d85faca2baf9e6dd8 mpage committed May 16, 2012
Showing with 10 additions and 2 deletions.
  1. +2 −0 lib/membrane/schema_parser.rb
  2. +8 −2 spec/schema_parser_spec.rb
@@ -55,6 +55,8 @@ def deparse(schema)
schema.value.inspect
when Membrane::Schema::Any
"any"
+ when Membrane::Schema::Bool
+ "bool"
else
schema.inspect
end
View
@@ -9,13 +9,19 @@
val.should_receive(:inspect).twice
schema = Membrane::Schema::Value.new(val)
- Membrane::SchemaParser.deparse(schema).should == val.inspect
+ parser.deparse(schema).should == val.inspect
end
it "should return 'any' for instance of Membrane::Schema::Any" do
schema = Membrane::Schema::Any.new
- Membrane::SchemaParser.deparse(schema).should == "any"
+ parser.deparse(schema).should == "any"
+ end
+
+ it "should return 'bool' for instances of Membrane::Schema::Bool" do
+ schema = Membrane::Schema::Bool.new
+
+ parser.deparse(schema).should == "bool"
end
end

0 comments on commit f72d2ab

Please sign in to comment.