#278 √ invalid
Dan Weinand

Better Test::Unit support

Reported by Dan Weinand | April 20th, 2008 @ 11:19 PM | in 0.9.4

Given:

Merb is promoted as being testing-framework-agnostic: you can use Test::Unit, Rspec, or test/spec.

Expected:

No testing-framework would be required by default.

Actual:

Rspec is a required dependency of merb-core.

Expected:

All testing-framework-specific helpers and rake tasks would be provided by optional plugins rather than being included in merb-core, as is the case with orms.

Actual:

43bdb1fe69b6f47e47a2ec2d4a197b592464135c in merb-plugins removed the merb_rspec plugin. 6a54e6c391aa01a9223d2b85772c539fa078214b in merb-core added rspec-specific rake tasks to core and removed code from use_test that auto-required the plugin for the selected testing framework.

Expected:

Setting use_test :test_unit in a fresh merb application's init.rb would provide access to Test::Unit rake tasks and would no longer display rspec rake tasks.

Actual:

Test::Unit rake tasks would only display when merb_test_unit was added as a dependency. Rspec tasks continued to show regardless.

Comments and changes to this ticket

  • Michael Klishin (antares)

    Michael Klishin (antares) April 30th, 2008 @ 11:48 PM

    Merb-core is tested with RSpec, there is no way you can go without it to run specs suite on gem installation, for instance.

    It does not force you to use RSpec for applications development in any way.

    I see no suggestions in this ticket. Just claims that something was expected. Expected by you but should be implemented by others?

  • Dan Weinand

    Dan Weinand May 1st, 2008 @ 12:12 AM

    It is understandable that rspec would be required for anyone who wants or needs to run the spec suite. However, an individual simply writing an application for merb, may never have that desire or need. Additionally, they may desire to have as little code as possible on a production server where framework specs would never be run.

    I don't particularly care for the attitude. This issue wasn't intended to be combative, nor am I unwilling to submit patches to provide better support for Test::Unit.

    I am simply seeking comment and clarification over problems I ran into while trying to develop a merb application that didn't use rspec. In particular, I'm unclear about the decision to eliminate the merb_rspec plugin and move it's helpers into core, while not doing the same with merb_test_unit. Without more information, its difficult for me to determine what's a bug, what's an error in documentation, and what's a deliberate change to merb's philosophy or approach.

  • Michael Klishin (antares)

    Michael Klishin (antares) May 1st, 2008 @ 12:15 AM

    Dan,

    Stop by #merb-hacking at irc.freenode.net to discuss this. Thanks.

  • Matt Aimonetti

    Matt Aimonetti May 1st, 2008 @ 10:20 PM

    merb is still testing framework agnostic, rspec doesn't get loaded when Merb starts and you don't have to use rspec.

    However for convenience reasons, it was decided to create a gem dependency to make sure people/devs have the proper version of rspec to test the framework.

    We are talking few Ks on your production server, don't tell me that it's a big deal ;)

    -Matt

  • Dan Weinand

    Dan Weinand May 1st, 2008 @ 10:38 PM

    The gem dependency isn't a huge deal.

    However, a fresh merb app's rakefile requires spec/rake/spectask regardless of any application settings. Setting use_test to :test_unit not only doesn't eliminate the rspec tasks, it doesn't actually add in the test_unit tasks.

    There also problems with the app-generator always generating specs, but I believe there's another ticket on that issue.

    At the very least the documentation needs to be updated to reflect the additional steps needed in order to get up and running on something besides rspec. Better yet, IMHO would be striving to maintain a consistent experience to that of choosing an orm, and a clear establishment of a single methodology for how testing frameworks should be incorporated. It seemed like merb had this until the commits mentioned, when an inconsistency was introduced.

    I'll try to stop by #merb-hacking when I get a chance for further discussion.

  • Michael Klishin (antares)

    Michael Klishin (antares) May 11th, 2008 @ 02:54 PM

    • → Assigned user changed from “” to “Michael Klishin (antares)”
    • → Milestone changed from “” to “0.9.4”
    • → State changed from “new” to “open”
  • Michael Klishin (antares)

    Michael Klishin (antares) June 2nd, 2008 @ 09:44 AM

    • → Title changed from “Merb no longer testing framework agnostic” to “Better Test::Unit support”
  • Michael Klishin (antares)

    Michael Klishin (antares) June 2nd, 2008 @ 09:44 AM

    • → Assigned user cleared.

    This is a Test::Unit support problem in general. I am RSpec user for year and half now, I think someone who uses Test::Unit with Merb would be a better person to take over this.

  • Michael D. Ivey (ivey)

    Michael D. Ivey (ivey) June 12th, 2008 @ 01:32 AM

    Dan, I agree with your basic goal. The problem is, none of the core team use Test::Unit, so we don't know where it sucks.

    We will gladly review and apply patches to make Merb more friendly for Test::Unit users.

    I'm closing this as it doesn't have any patches or anything for us to do. Please open new ticket(s) for specific fixes.

  • Michael D. Ivey (ivey)

    Michael D. Ivey (ivey) June 12th, 2008 @ 01:34 AM

    • → State changed from “open” to “invalid”

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tags