Posts Tagged ‘git’

Release 0.4.1

Thursday, March 27th, 2008

On the heels of yesterdays release of 0.4.0, there is a new release today, 0.4.1. Although this is not a sexy release, as 0.4.0 was, this is an important release.

What makes this release so important is that it fixes, adds, or improves testing support for Mack applications.

The implementation of some of the testing stuff has changed under the covers, but it’s the new stuff that is really important. let’s take a look at some of the stuff:

  • assigns(key) – This one should be familiar to all you Rails folks out there. This allows you to get an instance variable that was set in a controller, and access it in your test.
    def test_something
      get foo_index_url
      assert_not_nil assigns(:foo_list)
    end
  • in_session – This methods allows you to wrap a block in the context of a session. This is great if you’re trying to do integration testing.
  • set_cookie, remove_cookie – These methods allow you to either set or a remove a cookie in your tests. Great if you want to test an action that reads a cookie, or test to see what happens if you set a cookie, then remove the cookie and call something else. Also great to use with the in_session method.

There are a few other hidden treats in there, but those are some of the highlights. These things help bring Mack testing to a usable level.

The Mack Demo Blog application has been updated to demonstrate some these things. You can pull the demo using Git here: git://github.com/markbates/mack_blog_demo.git

Changelog:

  • Improved testing support.
  • Added assigns support to testing. This is allows for pulling instance variables that were set in a controller to tests.
  • Added ability to do ’session’ based tests.
  • Added assert_difference method.
  • Added ability to set/remove cookies before requests are made.
  • gem: mack_ruby_core_extensions 0.1.4
$ sudo gem install mack

Announcing Mack Ruby Core Extensions

Wednesday, March 26th, 2008

Mack has been using a combination of the ruby_extensions gem as well some local extensions to the Ruby core in order to make Mack as wonderful as it is. In an effort to make life a little simpler, as well as to help share the wealth, the ruby_extensions gem and the Mack extensions have been combined into a single new gem called mack_ruby_core_extensions.

One of the main Mack pieces that has been broken out into this new gem is the inflection system. Now you can have inflections as part of any Ruby application just by requiring the gem. As far as I can tell this is the first stand alone inflection system for Ruby. I know because I couldn’t find one for Mack, that’s why I had to write one.

This gem will continually be updated, outside of the core Mack code. The forthcoming release of Mack, 0.4.0, will be converted to use the new gem.

Those who wish to contribute to the gem can find it on GitHub at: http://github.com/markbates/mack_ruby_core_extensions

The API for mack_ruby_core_extensions can be found at:
http://mrce-api.mackframework.com/

 $ sudo gem install mack_ruby_core_extensions

Mack on GitHub.com

Friday, March 21st, 2008

The Mack source tree is now hosted on GitHub.com

http://github.com/markbates/mack

If you would like to pull it down you can clone it with:

git://github.com/markbates/mack.git

For those of you interested in contributing you can create an account with GitHub, fork the Mack project, go nuts with your changes, and then send me a pull request. It’s all very well explained on the GitHub site.

Enjoy!