Permalink
Browse files

Builder inherits from BlankSlate now

  • Loading branch information...
1 parent 88a951b commit d98e95bc3138d3f5022653bd07d675d356000e90 @davidhq davidhq committed Sep 27, 2009
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/asbestos.rb
  2. +5 −0 spec/asbestos_spec.rb
View
2 lib/asbestos.rb
@@ -36,7 +36,7 @@ def #{compiled_name}
end
end
- class Builder
+ class Builder < BlankSlate
def initialize(options = {})
@target = _new_hash
@options = options
View
5 spec/asbestos_spec.rb
@@ -19,6 +19,11 @@ def to_json
to_json.should == '{"foo":"bar"}'
end
+ it "should work when clashing with existing ruby methods like 'type'" do
+ @json.type('bar')
+ to_json.should == '{"type":"bar"}'
+ end
+
it "should add a key-value pair with `tag!`" do
@json.tag!(:foo, 'bar')
to_json.should == '{"foo":"bar"}'

0 comments on commit d98e95b

Please sign in to comment.