# \[ANN\] Obsidian Released

**URL:** <https://www.ruby-forum.com/t/ann-obsidian-released/134123>\
**Category:** Ruby\
**Created:** [April 8, 2008, 3:34am UTC](https://www.ruby-forum.com/t/ann-obsidian-released/134123 "2008-04-08T03:34:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_Bedra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8dc957/32.png) [@Aaron\_Bedra](https://www.ruby-forum.com/u/Aaron_Bedra)\
**Post date:** [April 8, 2008, 3:34am UTC](https://www.ruby-forum.com/t/ann-obsidian-released/134123/1 "2008-04-08T03:34:08Z")

</div>

== DESCRIPTION:

Obsidian. It’s metastable.  
Chunks of Ruby code we have found helpful.

== FEATURES/PROBLEMS:

=== Model Update Tracker  
This library allows you to functionally test updates to models with  
clearer and more focused intent.

It forces you to have a better understanding of how your Objects  
interact and let’s you demonstrate  
that knowledge by putting it in your tests. For example instead of  
writing a test like so

assert\_difference Asset :count do

post :create, :asset =\> {}  
end

you would write your test like so

assert\_models\_created(Asset) do  
post :create, :asset =\> {}  
end

Now if an asset really created multiple other objects such as an asset  
owner and a location the above

test would fail stating that it expected more to happen. This is  
where you excercise your deep domain  
knowledge muscles and make your new obsidian powered test pass.

assert\_models\_saved(Asset, AssetOwner, Location) do

post: create, :asset =\> {}  
end

You have just done youself a great service. If for some reason you  
change code that affects your  
object model and things fall out of place this test will catch that  
regression error where the original

assert\_difference may not. There are also a whole host of other  
methods you can use with model update  
tracker that provide functionality for updates, deletes, and  
no\_difference assertions.

- assert\_models\_created(models)

- assert\_models\_updated(models)

- assert\_models\_destroyed(models)

- assert\_no\_models\_created

- assert\_no\_models\_destroyed

- assert\_no\_models\_updated

== INSTALL:  
gem install obsidian
