# RSpec

**URL:** https://www.ruby-forum.com/c/testing/rspec/25.md?page=118

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 119

---

## [Autotest busted with Rspec/Rails trunk](https://www.ruby-forum.com/t/autotest-busted-with-rspec-rails-trunk/118849)

<div class="topic-metadata">

**Author:** [@sgarcia](https://www.ruby-forum.com/u/sgarcia)\
**Replies:** 6\
**Last updated:** [October 31, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/autotest-busted-with-rspec-rails-trunk/118849 "2007-10-31T20:33:28Z")

</div>

Just upgraded to latest rails and rspec builds and my autotest doesnt work undefined method \`before’ for Spec::Rails::DSL::RailsExample:Class (NoMethodError) Here’s the full trace: http://pastie.caboo.se/112754 Any…

---

## [Mocking Workers in Backgroundrb](https://www.ruby-forum.com/t/mocking-workers-in-backgroundrb/118244)

<div class="topic-metadata">

**Author:** [@codejoy](https://www.ruby-forum.com/u/codejoy)\
**Replies:** 3\
**Last updated:** [October 31, 2007, 8:29pm UTC](https://www.ruby-forum.com/t/mocking-workers-in-backgroundrb/118244 "2007-10-31T20:29:05Z")

</div>

Hi Has anyone mocked a call like the following for backgroundrb? MiddleMan.new\_worker(:class =\> :admin\_email\_worker, :args =\> params \[:email\]) I cannot seem to find the correct manner to do it. Would have liked to b…

---

## [Testing "XML views"](https://www.ruby-forum.com/t/testing-xml-views/118869)

<div class="topic-metadata">

**Author:** [@Matt\_Aimonetti](https://www.ruby-forum.com/u/Matt_Aimonetti)\
**Replies:** 0\
**Last updated:** [October 31, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/testing-xml-views/118869 "2007-10-31T19:45:12Z")

</div>

I put together a simple tutorial showing how I use Hpricot to tests my “XML views” http://railsontherun.com/2007/10/31/how-to-test-a-xml-builder-view I’m sure there are other ways and even maybe something built in RS…

---

## [Flash should be empty (typeError)?](https://www.ruby-forum.com/t/flash-should-be-empty-typeerror/118781)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 1\
**Last updated:** [October 30, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/flash-should-be-empty-typeerror/118781 "2007-10-30T22:39:51Z")

</div>

Hi, I’m trying to test wether flash.now\[:okay\] is not empty, but I always get the following error. TypeError in ‘UserController’ can’t convert String into Integer Can’t I test the flash if they are not emtpy? Thanks…

---

## [RSpec Texmate Bundle errors](https://www.ruby-forum.com/t/rspec-texmate-bundle-errors/118744)

<div class="topic-metadata">

**Author:** [@Arthur\_PSSSStry](https://www.ruby-forum.com/u/Arthur_PSSSStry)\
**Replies:** 7\
**Last updated:** [October 30, 2007, 6:39pm UTC](https://www.ruby-forum.com/t/rspec-texmate-bundle-errors/118744 "2007-10-30T18:39:29Z")

</div>

I’ve the same problem as Alastair when running rspec command : \[TxMt\] RSpec Bundle errors …/spec/mate/runner.rb:34:in run': undefined method parse’ for Spec::runner::OptionParser:Class I fixed this for me by changi…

---

## [Works in script but not in rake](https://www.ruby-forum.com/t/works-in-script-but-not-in-rake/117463)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 4\
**Last updated:** [October 30, 2007, 1:47pm UTC](https://www.ruby-forum.com/t/works-in-script-but-not-in-rake/117463 "2007-10-30T13:47:45Z")

</div>

Hi, This is weird All my current spec examples are passing (about 750 of 'em) except a set of 6 in a specific controller spec. I get the following failure on each 6 when I run it via $ rake spec for example: Action…

---

## [Note on Rails 2.0 Preview](https://www.ruby-forum.com/t/note-on-rails-2-0-preview/116136)

<div class="topic-metadata">

**Author:** [@Steve\_RSSCWD](https://www.ruby-forum.com/u/Steve_RSSCWD)\
**Replies:** 3\
**Last updated:** [October 29, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/note-on-rails-2-0-preview/116136 "2007-10-29T22:14:17Z")

</div>

Make sure you get a relatively current version of rspec or you will get: /Users/me/rails/ubb/vendor/rails/activerecord/lib/…/…/activesupport/ lib/active\_support/dependencies.rb:263:in \`load\_missing\_constant’: uninitia…

---

## [Rspec throws exception (nameError)](https://www.ruby-forum.com/t/rspec-throws-exception-nameerror/118647)

<div class="topic-metadata">

**Author:** [@jamal](https://www.ruby-forum.com/u/jamal)\
**Replies:** 2\
**Last updated:** [October 29, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/rspec-throws-exception-nameerror/118647 "2007-10-29T20:15:00Z")

</div>

Hi, I’m running Rails 1.2.5 with rspec 1.0.8. When i runned autotest first time, it complained about this line. #include ActionView::Helpers::JavaScriptMacrosHelper in vendor/plugins/rspec\_on\_rails/lib/spec/rails/dls…

---

## [How is everyone structuring stories?](https://www.ruby-forum.com/t/how-is-everyone-structuring-stories/118108)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 10\
**Last updated:** [October 29, 2007, 6:40pm UTC](https://www.ruby-forum.com/t/how-is-everyone-structuring-stories/118108 "2007-10-29T18:40:05Z")

</div>

Bleeding-edge story-writers, How are you structuring your specs? I am working on a new project and tried this: ./lib ./blah ./spec ./blah ./stories But it breaks autotest, so I moved stories parallel to lib and s…

---

## [Failing test with nested controller routes](https://www.ruby-forum.com/t/failing-test-with-nested-controller-routes/118525)

<div class="topic-metadata">

**Author:** [@nola](https://www.ruby-forum.com/u/nola)\
**Replies:** 2\
**Last updated:** [October 28, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/failing-test-with-nested-controller-routes/118525 "2007-10-28T16:30:55Z")

</div>

I have googled and browsed through spec-users archives, but didn’t find anything different. I used rspec scaffold command to generate a mvc for groups, I used nested controller so I could have a separate interface for…

---

## [Spec\_distributed with rails](https://www.ruby-forum.com/t/spec-distributed-with-rails/118511)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 2\
**Last updated:** [October 28, 2007, 2:45am UTC](https://www.ruby-forum.com/t/spec-distributed-with-rails/118511 "2007-10-28T02:45:18Z")

</div>

Is this the appropriate place to talk about spec\_distributed? If not, I’ll post the spec-ext (seemingly dead) mailing list on rubyforge… I was able to run a non-rails project with Spec::Distributed::RindaSlaveRunner…

---

## [Strange warnings with view specs](https://www.ruby-forum.com/t/strange-warnings-with-view-specs/118490)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 2\
**Last updated:** [October 27, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/strange-warnings-with-view-specs/118490 "2007-10-27T19:45:11Z")

</div>

I’ve been seeing the following in some of my view specs: .P.P…ignoring attempt to close spec::mocks::mock:0x7334c4c with td opened at byte 258, line 20 closed at byte 287, line 20 attributes at open: {} text around…

---

## [Examples of writing controller specs that use authentication](https://www.ruby-forum.com/t/examples-of-writing-controller-specs-that-use-authentication/118463)

<div class="topic-metadata">

**Author:** [@Leslie\_F](https://www.ruby-forum.com/u/Leslie_F)\
**Replies:** 2\
**Last updated:** [October 27, 2007, 12:10pm UTC](https://www.ruby-forum.com/t/examples-of-writing-controller-specs-that-use-authentication/118463 "2007-10-27T12:10:44Z")

</div>

Hello, I’m working on specs for a controller that handles authentication using the restful\_authentication plugin. I’m trying to find a resource (tutorial or examples, if possible) about the best way to go about writi…

---

## [Weird failing spec](https://www.ruby-forum.com/t/weird-failing-spec/118419)

<div class="topic-metadata">

**Author:** [@Tarsoly\_AndrSSSSs](https://www.ruby-forum.com/u/Tarsoly_AndrSSSSs)\
**Replies:** 7\
**Last updated:** [October 27, 2007, 7:24am UTC](https://www.ruby-forum.com/t/weird-failing-spec/118419 "2007-10-27T07:24:58Z")

</div>

Hi guys, I have a weird failing spec, for which I just cannot figure out the reason of failure. I’m now rewriting my controller specs based on the advice of David and Ashley, and I got stuck on this (see: \[rspec- use…

---

## [Rspec and capistrano](https://www.ruby-forum.com/t/rspec-and-capistrano/118394)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 2\
**Last updated:** [October 26, 2007, 10:43pm UTC](https://www.ruby-forum.com/t/rspec-and-capistrano/118394 "2007-10-26T22:43:07Z")

</div>

Hi, has anyone here written a capistrano task for rspec to run through my specs on the deployed server? I’d appreciate a snippet or two to get me started. Thx linoj

---

## [Rspec\_autotest failing](https://www.ruby-forum.com/t/rspec-autotest-failing/118423)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 7\
**Last updated:** [October 26, 2007, 10:00pm UTC](https://www.ruby-forum.com/t/rspec-autotest-failing/118423 "2007-10-26T22:00:23Z")

</div>

Is the rspec\_autotest plugin mentioned here, http://blog.nicksieger.com/articles/2006/11/15/rspec-autotest-now-a-rails-plugin the accepted method of auto testing specs? It’s an old article, and after grabbing the plu…

---

## [Specing with Subdomains as Account Keys](https://www.ruby-forum.com/t/specing-with-subdomains-as-account-keys/118396)

<div class="topic-metadata">

**Author:** [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Replies:** 3\
**Last updated:** [October 26, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/specing-with-subdomains-as-account-keys/118396 "2007-10-26T21:42:11Z")

</div>

How do you go about implementing and rspecing subdomains as account keys? I’m sure that this must be an issues for others as well. So I have an app using subdomains as account keys. The Application Controller sets up @…

---

## [Spec custom finders](https://www.ruby-forum.com/t/spec-custom-finders/118416)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 1\
**Last updated:** [October 26, 2007, 8:11pm UTC](https://www.ruby-forum.com/t/spec-custom-finders/118416 "2007-10-26T20:11:28Z")

</div>

I have some finders in my models where I write some of the sql myself. I of course want to test these, but am not sure the best way. Should I just let them roll through to the db, and verify they return the correct o…

---

## [Scenarios Plugin Pre-Announcement](https://www.ruby-forum.com/t/scenarios-plugin-pre-announcement/117450)

<div class="topic-metadata">

**Author:** [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Replies:** 9\
**Last updated:** [October 26, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/scenarios-plugin-pre-announcement/117450 "2007-10-26T18:54:48Z")

</div>

This is sort of a pre-announcement for a Rails plugin my friend Adam Williams and I are working on. We’re in the process of extracting it from a project we are working on so that it can be generally useful to the Rail…

---

## [Easy AR association stubbing](https://www.ruby-forum.com/t/easy-ar-association-stubbing/118399)

<div class="topic-metadata">

**Author:** [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Replies:** 1\
**Last updated:** [October 26, 2007, 5:30pm UTC](https://www.ruby-forum.com/t/easy-ar-association-stubbing/118399 "2007-10-26T17:30:00Z")

</div>

On 10/5/07, Andrew WC Brown \<omen.king at gmail.com\> wrote: I’ve added a method to the mock class that makes it pretty easy to stub associations in rails. I’ve been using it for awhile and it seems to cut down on a l…

---

## [Textmate Formatting has gone away](https://www.ruby-forum.com/t/textmate-formatting-has-gone-away/118397)

<div class="topic-metadata">

**Author:** [@liquid](https://www.ruby-forum.com/u/liquid)\
**Replies:** 3\
**Last updated:** [October 26, 2007, 4:23pm UTC](https://www.ruby-forum.com/t/textmate-formatting-has-gone-away/118397 "2007-10-26T16:23:12Z")

</div>

Hi, I just updated my Textmate bundle to the latest in the svn because It wasn’t working with the latest version of rspec. It’s been a while since I updated the bundle :wink: I like the format that I used to have …

---

## [Specing rescue, ensure and else blocks of an Exception](https://www.ruby-forum.com/t/specing-rescue-ensure-and-else-blocks-of-an-exception/118389)

<div class="topic-metadata">

**Author:** [@Tarsoly\_AndrSSSSs](https://www.ruby-forum.com/u/Tarsoly_AndrSSSSs)\
**Replies:** 5\
**Last updated:** [October 26, 2007, 2:02pm UTC](https://www.ruby-forum.com/t/specing-rescue-ensure-and-else-blocks-of-an-exception/118389 "2007-10-26T14:02:48Z")

</div>

Greetings, I’m using rspec with rcov for my applications and there is one issue which I cannot solve nor can find any proper information regarding it: specing what is in a rescue block in case of an exception. I’m us…

---

## [Spec\_server doesn't update 'required' files](https://www.ruby-forum.com/t/spec-server-doesnt-update-required-files/118357)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 4\
**Last updated:** [October 26, 2007, 1:37pm UTC](https://www.ruby-forum.com/t/spec-server-doesnt-update-required-files/118357 "2007-10-26T13:37:38Z")

</div>

I have some specs that ‘require’ other files. When running spec\_server, if these required files are changed, it’s not picked up when the specs are run. I have to restart spec\_server to get the changes recognized. Is …

---

## ["WARNING" after each spec](https://www.ruby-forum.com/t/warning-after-each-spec/118260)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 3\
**Last updated:** [October 26, 2007, 2:24am UTC](https://www.ruby-forum.com/t/warning-after-each-spec/118260 "2007-10-26T02:24:06Z")

</div>

I just updated to r2784, and now all of my specs output the ‘.’ and then ‘WARNING: there is already a transaction in progress’, either once or twice before the next dot. It’s indicating that all specs are passing, th…

---

## [Re: How do you specify a rubygem is being required?](https://www.ruby-forum.com/t/re-how-do-you-specify-a-rubygem-is-being-required/118346)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 0\
**Last updated:** [October 25, 2007, 9:14pm UTC](https://www.ruby-forum.com/t/re-how-do-you-specify-a-rubygem-is-being-required/118346 "2007-10-25T21:14:48Z")

</div>

Glad that was helpful! Al ----- Original Message ---- From: Ashley M. removed\_email\_address@domain.invalid To: rspec-users removed\_email\_address@domain.invalid Sent: Thursday, October 25, 2007 12:01:11 PM Subject: …

---

## [Re: How do you specify a rubygem is being required?](https://www.ruby-forum.com/t/re-how-do-you-specify-a-rubygem-is-being-required/118251)

<div class="topic-metadata">

**Author:** [@Al\_Chou](https://www.ruby-forum.com/u/Al_Chou)\
**Replies:** 1\
**Last updated:** [October 25, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/re-how-do-you-specify-a-rubygem-is-being-required/118251 "2007-10-25T21:02:30Z")

</div>

RubyGems does indeed muck with the “require” method. I believe the current version uses the “gem” method and deprecates the “require” method. Rails warns me about something to that effect whenever I run script/server…

---

## [Using Mechanize in Story Step Implementations](https://www.ruby-forum.com/t/using-mechanize-in-story-step-implementations/118182)

<div class="topic-metadata">

**Author:** [@andywatts](https://www.ruby-forum.com/u/andywatts)\
**Replies:** 3\
**Last updated:** [October 25, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/using-mechanize-in-story-step-implementations/118182 "2007-10-25T20:56:37Z")

</div>

Hi, Thought this might be of interest story writers. The mechanize plugin seems to play nice with RSpec. The following mix of methods seems to work just fine. I especially like the helpers for populating forms. agen…

---

## [MountainWest RubyConf 2008](https://www.ruby-forum.com/t/mountainwest-rubyconf-2008/118328)

<div class="topic-metadata">

**Author:** [@pat\_eyler](https://www.ruby-forum.com/u/pat_eyler)\
**Replies:** 0\
**Last updated:** [October 25, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/mountainwest-rubyconf-2008/118328 "2007-10-25T19:30:39Z")

</div>

MountainWest RubyConf 2008 is scheduled for March 28 and 29, 2008. It will be in Salt Lake City, at the same great venue we had last year, and it is again our intent to record and make available all the talks under a …

---

## [Mocking/Stubbing help with subdomain as account key](https://www.ruby-forum.com/t/mocking-stubbing-help-with-subdomain-as-account-key/118320)

<div class="topic-metadata">

**Author:** [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Replies:** 1\
**Last updated:** [October 25, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/mocking-stubbing-help-with-subdomain-as-account-key/118320 "2007-10-25T17:53:30Z")

</div>

My app uses account\_location to set up subdomains as account keys. In my controllers, all my model operations are scoped through the @current\_person object. The question is: How do I test this with RSpec’s mocking and …

---

## [Rollbacks, Sqlite3 bug](https://www.ruby-forum.com/t/rollbacks-sqlite3-bug/118255)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 6\
**Last updated:** [October 25, 2007, 5:27pm UTC](https://www.ruby-forum.com/t/rollbacks-sqlite3-bug/118255 "2007-10-25T17:27:46Z")

</div>

Okay - so the sqlite bug reported a day or so ago on the list is real bug. I’m going to file something in the tracker for that… I also learned that before(:all)…after(:all) is not wrapped in a transaction, the way be…

[Previous page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=117)

[Next page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=119)
