#100 ✓resolved
Josh Knowles

Webrat.configuration.mode effecting specs

Reported by Josh Knowles | December 25th, 2008 @ 05:22 PM

I started writing specs for the SinatraSession and all of a sudden all of the Rails specs started failing. I tracked it down to the fact that at the bottom of webrat/sinatra, which I required, it as the following:

Webrat.configuration.mode = :sinatra

Seems like dependent on the order that things get run this will then cause subsequent Rails specs to fail unless reset to:

Webrat.configuration.mode = :rails.

This seems pretty brittle. Thoughts on how to refactor?

Comments and changes to this ticket

  • Bryan Helmkamp

    Bryan Helmkamp December 27th, 2008 @ 03:10 PM

    • State changed from “new” to “resolved”

    I've added a before(:each) and after(:each) to the spec_helper which stores and reset the Webrat configuration.

    Inside an example group, it should now work fine to do a line like:

    Webrat.configuration.mode = :sinatra

    And it won't affect any examples outside of that group.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket