# RSpec

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

[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:** 122

---

## [Intro article](https://www.ruby-forum.com/t/intro-article/117318)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 0\
**Last updated:** [October 15, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/intro-article/117318 "2007-10-15T23:31:58Z")

</div>

fyi http://www.vaporbase.com/postings/ Beginners\_Guide\_to\_Rspec\_on\_Story\_Runner

---

## [Story Runner: Readability of output with multiple params](https://www.ruby-forum.com/t/story-runner-readability-of-output-with-multiple-params/117118)

<div class="topic-metadata">

**Author:** [@andywatts](https://www.ruby-forum.com/u/andywatts)\
**Replies:** 13\
**Last updated:** [October 15, 2007, 8:14pm UTC](https://www.ruby-forum.com/t/story-runner-readability-of-output-with-multiple-params/117118 "2007-10-15T20:14:31Z")

</div>

Fistly, many, many thanks for RSpec and Story Runner. Minor request to improve readability of output Given a scenario item with multiple params… Eg. And “the user belongs to”, “Joe”, “Acme” do |user\_name, company\_na…

---

## [Story Runner: 'When..Then..Then..Then' stories](https://www.ruby-forum.com/t/story-runner-when-then-then-then-stories/117255)

<div class="topic-metadata">

**Author:** [@andywatts](https://www.ruby-forum.com/u/andywatts)\
**Replies:** 0\
**Last updated:** [October 15, 2007, 1:00pm UTC](https://www.ruby-forum.com/t/story-runner-when-then-then-then-stories/117255 "2007-10-15T13:00:14Z")

</div>

Maybe I’m slow, but I just noticed that the following code… Then ‘I login’ Then ‘I do something else’ …will output as… Then ‘I login’ And ‘I do something else’ The same is true for two ‘When’ steps This may have i…

---

## [Edge rspec - running Test::Unit tests](https://www.ruby-forum.com/t/edge-rspec-running-test-unit-tests/117075)

<div class="topic-metadata">

**Author:** [@Alvin\_S](https://www.ruby-forum.com/u/Alvin_S)\
**Replies:** 1\
**Last updated:** [October 14, 2007, 3:54pm UTC](https://www.ruby-forum.com/t/edge-rspec-running-test-unit-tests/117075 "2007-10-14T15:54:31Z")

</div>

With rspec 1.0.8 I can run Test::Unit tests and rspec tests using: rake default and all tests and specs run. With edge rspec the Test::Unit tests return with the message: \[list of tests\] Finished in 4.5e-05 seconds …

---

## [Story Runner: DRYing items used in many stories](https://www.ruby-forum.com/t/story-runner-drying-items-used-in-many-stories/117168)

<div class="topic-metadata">

**Author:** [@andywatts](https://www.ruby-forum.com/u/andywatts)\
**Replies:** 1\
**Last updated:** [October 14, 2007, 6:56am UTC](https://www.ruby-forum.com/t/story-runner-drying-items-used-in-many-stories/117168 "2007-10-14T06:56:49Z")

</div>

The number of stories I have is growing and I’m writing the following step long hand in each story. Given 'a user named', 'Andy', 'Watts' do |first\_name, family\_name| @email = first\_name + '@test.lan' create\_user(…

---

## [NO NAME (Because of --dry-run) output](https://www.ruby-forum.com/t/no-name-because-of-dry-run-output/116511)

<div class="topic-metadata">

**Author:** [@joshua\_s](https://www.ruby-forum.com/u/joshua_s)\
**Replies:** 4\
**Last updated:** [October 14, 2007, 5:47am UTC](https://www.ruby-forum.com/t/no-name-because-of-dry-run-output/116511 "2007-10-14T05:47:20Z")

</div>

I’m just getting started with rspec, I’m running on edge for both. In a fresh project, I freeze edge, install the edge rspec plugin. I generate a simple rspec\_model and run the spec. It passes. When I run rake spe…

---

## [\[RSpec\] Unexpected behavior using TextMate Bundle](https://www.ruby-forum.com/t/rspec-unexpected-behavior-using-textmate-bundle/117117)

<div class="topic-metadata">

**Author:** [@Mel\_R](https://www.ruby-forum.com/u/Mel_R)\
**Replies:** 3\
**Last updated:** [October 13, 2007, 8:00pm UTC](https://www.ruby-forum.com/t/rspec-unexpected-behavior-using-textmate-bundle/117117 "2007-10-13T20:00:50Z")

</div>

Howdy, Why does the bundle NOT work when I do the following: Start TextMate Open my project Open my spec Try to run spec and get an error While the following DOES work: Open Terminal Locate my project Start TextMat…

---

## [Specing system](https://www.ruby-forum.com/t/specing-system/117133)

<div class="topic-metadata">

**Author:** [@Priit\_T](https://www.ruby-forum.com/u/Priit_T)\
**Replies:** 1\
**Last updated:** [October 13, 2007, 7:11pm UTC](https://www.ruby-forum.com/t/specing-system/117133 "2007-10-13T19:11:41Z")

</div>

Hi! Having some wine on Saturday and just playing around writing some ruby script: have you spec any ‘system’ method? As long I know it just returns false or true and everything else is just out of reach; prove me I…

---

## [Locals in partials](https://www.ruby-forum.com/t/locals-in-partials/117065)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 6\
**Last updated:** [October 12, 2007, 8:49pm UTC](https://www.ruby-forum.com/t/locals-in-partials/117065 "2007-10-12T20:49:54Z")

</div>

hiya, in specing a partial, how can i assign a local var that is normally passed via :locals ? i tried adding :locals =\> to the render call but that doesnt seem to take linoj

---

## [Speccing a rake task](https://www.ruby-forum.com/t/speccing-a-rake-task/117082)

<div class="topic-metadata">

**Author:** [@danhobbs](https://www.ruby-forum.com/u/danhobbs)\
**Replies:** 0\
**Last updated:** [October 12, 2007, 7:46pm UTC](https://www.ruby-forum.com/t/speccing-a-rake-task/117082 "2007-10-12T19:46:00Z")

</div>

Greetings, I’m writing a custom rake task, and I’d like to write an assosciated spec for it. Does anyone have an example spec for a rake task? I’ve seen some examples on the web that use these before blocks: before(…

---

## [\[RSpec\] Question about using TextMate Bundle](https://www.ruby-forum.com/t/rspec-question-about-using-textmate-bundle/116995)

<div class="topic-metadata">

**Author:** [@Mel\_R](https://www.ruby-forum.com/u/Mel_R)\
**Replies:** 4\
**Last updated:** [October 12, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/rspec-question-about-using-textmate-bundle/116995 "2007-10-12T16:56:03Z")

</div>

Hey Everyone, First time poster! woot! Can someone please point me to a Wiki, FAQ, web page, that I can reference to help me debug why my installation of the TextMate Bundle doesn’t work? Am I supposed to install t…

---

## [Login testing ideas](https://www.ruby-forum.com/t/login-testing-ideas/116981)

<div class="topic-metadata">

**Author:** [@barsalou](https://www.ruby-forum.com/u/barsalou)\
**Replies:** 2\
**Last updated:** [October 12, 2007, 5:42am UTC](https://www.ruby-forum.com/t/login-testing-ideas/116981 "2007-10-12T05:42:17Z")

</div>

I’ve been going through Pat’s example story and noticed that there was no checking for a bad login. I assume this is because that would have made the article bigger and more complicated than it needed to be. So the q…

---

## [Incompatibility Issues after updating CURRENT](https://www.ruby-forum.com/t/incompatibility-issues-after-updating-current/116971)

<div class="topic-metadata">

**Author:** [@katrash](https://www.ruby-forum.com/u/katrash)\
**Replies:** 2\
**Last updated:** [October 11, 2007, 8:27pm UTC](https://www.ruby-forum.com/t/incompatibility-issues-after-updating-current/116971 "2007-10-11T20:27:51Z")

</div>

Hi, I’m using piston to manage rspec and rspec\_on\_rails in vendor/plugins. ~/work/simplify\_md $ piston st vendor/plugins/ vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec) vendor/plugins/…

---

## [Autotest and RSpect](https://www.ruby-forum.com/t/autotest-and-rspect/116951)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 3\
**Last updated:** [October 11, 2007, 6:04pm UTC](https://www.ruby-forum.com/t/autotest-and-rspect/116951 "2007-10-11T18:04:22Z")

</div>

I managed to have Autotest running on my windows box. Apparently all is working but every time I know there is an error a new line is generated, no error messages or anything is sent to the console. I am using pastie …

---

## [RSpec seems to be having a hard time loading Helper classes](https://www.ruby-forum.com/t/rspec-seems-to-be-having-a-hard-time-loading-helper-classes/116899)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 2\
**Last updated:** [October 11, 2007, 3:33pm UTC](https://www.ruby-forum.com/t/rspec-seems-to-be-having-a-hard-time-loading-helper-classes/116899 "2007-10-11T15:33:00Z")

</div>

I am getting the error when I run the command: rake spec This is a new project with not current test written besides the ones auto-created for me. +++++++++ $ rake spec (in /Users/chrisolsen/Projects/Rails/chrisolse…

---

## [I can't make RSpec 1.0.8 run in Rails 1.2.3](https://www.ruby-forum.com/t/i-cant-make-rspec-1-0-8-run-in-rails-1-2-3/116481)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 7\
**Last updated:** [October 10, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/i-cant-make-rspec-1-0-8-run-in-rails-1-2-3/116481 "2007-10-10T16:31:54Z")

</div>

I followed the directions on the site: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL\_1\_0\_8/rspec\_on\_rails ruby …

---

## [I can't make RSpec 1.0.8 run in Rails 1.2.3](https://www.ruby-forum.com/t/i-cant-make-rspec-1-0-8-run-in-rails-1-2-3/116773)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 1\
**Last updated:** [October 9, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/i-cant-make-rspec-1-0-8-run-in-rails-1-2-3/116773 "2007-10-09T17:56:35Z")

</div>

I followed the directions on the site: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL\_1\_0\_8/rspec\_on\_rails ruby …

---

## [Can't debug specs in Netbeans](https://www.ruby-forum.com/t/cant-debug-specs-in-netbeans/116708)

<div class="topic-metadata">

**Author:** [@Richard\_Poirier](https://www.ruby-forum.com/u/Richard_Poirier)\
**Replies:** 0\
**Last updated:** [October 8, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/cant-debug-specs-in-netbeans/116708 "2007-10-08T22:05:26Z")

</div>

Hi. I can’t seem to get debugging of specs working in Netbeans. AFAIK, I’m supposed to be able to just do Command+Shift+F5 with the spec open in the editor but i get this error: /Users/admin/src/expresso/vendor/plug…

---

## [Skip pending (was Re: Posted this in "dev" last night but I'm not sure that anyone reads it)](https://www.ruby-forum.com/t/skip-pending-was-re-posted-this-in-dev-last-night-but-im-not-sure-that-anyone-reads-it/116076)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 1\
**Last updated:** [October 8, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/skip-pending-was-re-posted-this-in-dev-last-night-but-im-not-sure-that-anyone-reads-it/116076 "2007-10-08T21:44:15Z")

</div>

The way I’ve started using story runner is to write the story and scenarios, and then implement each step incrementally. The order that I implement is not necessarily the order its logically written. Lets say I want t…

---

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

<div class="topic-metadata">

**Author:** [@Matthew\_Heidemann](https://www.ruby-forum.com/u/Matthew_Heidemann)\
**Replies:** 5\
**Last updated:** [October 8, 2007, 9:26pm UTC](https://www.ruby-forum.com/t/easy-ar-association-stubbing/116406 "2007-10-08T21:26:35Z")

</div>

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 lot of setup code for the controller and model specs that use …

---

## [Stub actions that depend on the parameter](https://www.ruby-forum.com/t/stub-actions-that-depend-on-the-parameter/116695)

<div class="topic-metadata">

**Author:** [@Borja\_MartSSS\_n](https://www.ruby-forum.com/u/Borja_MartSSS_n)\
**Replies:** 6\
**Last updated:** [October 8, 2007, 8:52pm UTC](https://www.ruby-forum.com/t/stub-actions-that-depend-on-the-parameter/116695 "2007-10-08T20:52:35Z")

</div>

Hi, I’m pretty new to all related to bdd and rspec and I have the following question. Is it possible to stub actions that return different objects depending on the parameteres they were called with? Something like thi…

---

## [Spec'in controllers request for nested routes](https://www.ruby-forum.com/t/specin-controllers-request-for-nested-routes/116686)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 5\
**Last updated:** [October 8, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/specin-controllers-request-for-nested-routes/116686 "2007-10-08T19:45:02Z")

</div>

describe PlayersController, “handling GET /saltmines/games/1/players” do before do @game = mock\_model(Game, :to\_param =\> “1”) @game.stub\_association!(:players, :find =\> mock\_model(Player)) end def do\_get get :index…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/196483)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 0\
**Last updated:** [October 8, 2007, 5:16pm UTC](https://www.ruby-forum.com/t/no-subject/196483 "2007-10-08T17:16:28Z")

</div>

Just ran svn up this morning, and got this (after running ./script/ generate rspec) escher: ./script/spec spec/models/item\_spec.rb Finished in 8.0e-06 seconds 0 examples, 0 failures ./script/spec:4:in \`run’: wrong n…

---

## [Using mocks in classes](https://www.ruby-forum.com/t/using-mocks-in-classes/116667)

<div class="topic-metadata">

**Author:** [@Guff](https://www.ruby-forum.com/u/Guff)\
**Replies:** 0\
**Last updated:** [October 8, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/using-mocks-in-classes/116667 "2007-10-08T17:11:45Z")

</div>

I am mocking a rails model that hasn’t been implemented and belongs\_to a model that I am developing with rspec. The model in development, Audit, has\_many AuditItems which is being mocked. When created, Audit creates …

---

## [Spec/Test Speed](https://www.ruby-forum.com/t/spec-test-speed/116285)

<div class="topic-metadata">

**Author:** [@sthorpe](https://www.ruby-forum.com/u/sthorpe)\
**Replies:** 16\
**Last updated:** [October 8, 2007, 6:19am UTC](https://www.ruby-forum.com/t/spec-test-speed/116285 "2007-10-08T06:19:59Z")

</div>

Just wanted to pick some smart people about this topic: What are you guys doing to increase the speed of your specs? I’m a big fan of autotest, but right now my current project has 438 specs (for rails). Most of them…

---

## [Is there a way to use the rescue\_action defined in a controller in the controller's specs?](https://www.ruby-forum.com/t/is-there-a-way-to-use-the-rescue-action-defined-in-a-controller-in-the-controllers-specs/116559)

<div class="topic-metadata">

**Author:** [@Thorben\_SchrSSSSder](https://www.ruby-forum.com/u/Thorben_SchrSSSSder)\
**Replies:** 0\
**Last updated:** [October 7, 2007, 9:44am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-use-the-rescue-action-defined-in-a-controller-in-the-controllers-specs/116559 "2007-10-07T09:44:24Z")

</div>

Heyho, I start to discover RSpec but it seems that just on my second day I ran into some strange trouble with the rescue\_action of my controllers. Just like in Rails 2.0 where there is a rescue\_from Exception, :with …

---

## [Specing exit codes](https://www.ruby-forum.com/t/specing-exit-codes/116545)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 2\
**Last updated:** [October 7, 2007, 8:54am UTC](https://www.ruby-forum.com/t/specing-exit-codes/116545 "2007-10-07T08:54:03Z")

</div>

I am writing a small ruby script that will be accepting input from postfix’s pipe command (ie, not running via the shell, directly executing). One of the things I need to do it spec the exit codes to make sure I am r…

---

## [Spec'ing views, mock\_model associations](https://www.ruby-forum.com/t/specing-views-mock-model-associations/116524)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 4\
**Last updated:** [October 6, 2007, 11:16pm UTC](https://www.ruby-forum.com/t/specing-views-mock-model-associations/116524 "2007-10-06T23:16:27Z")

</div>

I writing a spec that returns the count of how many players in a game: it “should how many players in a link to all players” do render :partial =\>“games/game”, :object =\> @game response.should have\_tag(‘a’,"(2) Player…

---

## [Spec'ing view render partial collection, local variable not found](https://www.ruby-forum.com/t/specing-view-render-partial-collection-local-variable-not-found/116484)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 13\
**Last updated:** [October 6, 2007, 4:16pm UTC](https://www.ruby-forum.com/t/specing-view-render-partial-collection-local-variable-not-found/116484 "2007-10-06T16:16:43Z")

</div>

I’m trying to spec out a render partial collection but I get the following error NoMethodError in ‘/games/\_game.rhtml should show game name’ undefined method body' for #\<#\<Class:0x316580c\>:0x2f1154c\> /Volumes/EXT…

---

## [Have\_xml\_tag](https://www.ruby-forum.com/t/have-xml-tag/116423)

<div class="topic-metadata">

**Author:** [@codejoy](https://www.ruby-forum.com/u/codejoy)\
**Replies:** 4\
**Last updated:** [October 6, 2007, 4:35am UTC](https://www.ruby-forum.com/t/have-xml-tag/116423 "2007-10-06T04:35:53Z")

</div>

Hi Was just using have\_tag on an xml response and found the problem outlined and resolved here http://weblog.jamisbuck.org/2007/1/4/assert\_xml\_select Just wondered if there is any support in rspec? Cheers Shane Sh…

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

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