beta versions of shoulda, shoulda-context, and shoulda-matchers

71 views
Skip to first unread message

Joe Ferris

unread,
Jan 19, 2011, 12:16:04 PM1/19/11
to sho...@googlegroups.com
Hey everybody,

Starting with the next release, we're planning on splitting shoulda up into two separate libraries: shoulda-context and shoulda-matchers.

== shoulda-matchers


Traditionally, shoulda provided helpers for testing common Rails functionality in the form of "macros." We've been transitioning for a while towards matchers as a standard, which were easier to test, reuse, and are usable from both RSpec and Test::Unit. All matchers and Rails-specific functionality is now contained in this gem. If you're using RSpec, this gem is all you need.

== shoulda-context


The Test::Unit context framework, which provides things like "context" and "should," will live in shoulda-context. This library has no dependencies and won't contain anything Rails-specific. The primary purpose is to add a lightweight syntax on top of Test::Unit for writing prettier tests. It also adds hooks and assertions so that RSpec-like matchers can be used with Test::Unit in a "macro" style, although this library doesn't provide any matchers. If you just want the context syntax for Test::Unit, this gem is all you need. If you want both the matchers and the context library (the traditional package), you can depend on the shoulda gem, which will load both.

Internally, thoughtbot has been favoring RSpec over the shoulda context library for some time, but we realize the value in a lighter library and understand that some people still wish to use the shoulda context library. However, we found that we're not enthusiastic about maintaining something we don't want to use ourselves, so we don't plan on adding new features to it. You should still feel free to submit bugs and patches, though. Ryan McGeary has been a maintainer of shoulda for a long time, and he'll be the primary maintainer of shoulda-context moving forward.

== The big picture

We think that separating the concerns of this library will make shoulda easier to maintain and use. Everybody can use exactly what they want, and we also hope that separating the gems will mean that the release cycles aren't tied together, so they can progress at their own natural, independent pace. It also allows us to appropriately add gem dependencies to the matchers without impacting users that just want a lightweight context syntax.

In order to prevent confusion, we're keeping all Github issues in the central repository: https://github.com/thoughtbot/shoulda

We released beta versions of the three new shoulda gems today. Please try them out, and let us know what you think of this approach.

Thanks,
-Joe

k...@metaskills.net

unread,
Jan 24, 2011, 3:58:50 PM1/24/11
to shoulda

Ryan McGeary

unread,
Jan 24, 2011, 4:23:31 PM1/24/11
to sho...@googlegroups.com
Ken,

Very cool and elegant approach. We should get together and talk sometime about seeing if it's feasible to squeeze the rest of the shoulda-context features in there (before_should, subject blocks, multiple setups within same context, etc).  It may very well be a good new underpinning for shoulda-context as a whole.

-Ryan

On Mon, Jan 24, 2011 at 3:58 PM, k...@metaskills.net <k...@metaskills.net> wrote:

--
Individuals over processes. Interactions over tools.

Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, & Factory Girl:
http://thoughtbot.com/services/training

The Shoulda group:
http://groups.google.com/group/shoulda

To post to this group, send email to
sho...@googlegroups.com

To unsubscribe from this group, send email to
shoulda+u...@googlegroups.com

Ken Collins

unread,
Jan 25, 2011, 8:20:27 PM1/25/11
to sho...@googlegroups.com

The first challenge that I see is the way rails works. It always subclasses ActiveSupport::TestCase from Test::Unit::TestCase. That constant will basically be MiniTest::Unit under 1.9. Since the work I started is really on top of MiniTest::Spec which is on top of MiniTest::Unit, that would need to be solved somehow. If not, then shoulda-context would have to be designed on top of MiniTest::Unit :/

 - Ken
Reply all
Reply to author
Forward
0 new messages