Skip to content

Commit

Permalink
ImmutableDocument#make_mutable! has been added
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Rashkovskii committed May 4, 2008
1 parent 9f65b9c commit e88d174
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/strokedb/document.rb
Expand Up @@ -745,5 +745,9 @@ def mutable?
def save!
self
end

def make_mutable!
unextend(ImmutableDocument)
end
end
end
17 changes: 17 additions & 0 deletions spec/lib/strokedb/document/document_spec.rb
Expand Up @@ -819,6 +819,23 @@
@document.should_not == @another_document
end

end

describe "Immutable Document" do

before(:each) do
setup_default_store
@document = Document.new(:some_data => 1).make_immutable!
@document.should_not be_mutable
end

it "should be able to be mutable again" do
@document.make_mutable!
@document.should be_mutable
end



end

describe "Valid Document's JSON" do
Expand Down

0 comments on commit e88d174

Please sign in to comment.