# RSpec

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

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

---

## [Re: Generated rspec video](https://www.ruby-forum.com/t/re-generated-rspec-video/128856)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [February 12, 2008, 5:33am UTC](https://www.ruby-forum.com/t/re-generated-rspec-video/128856 "2008-02-12T05:33:29Z")

</div>

In reply to “Andrew WC Brown” removed\_email\_address@domain.invalid on Tue Feb 12 05:18:49 2008: Load Failed Reason : Operation could not be completed. (WebKitErrorDomain error 204.) http://chmeee.dyndns.org/ruby/…

---

## [Colored output for stories?](https://www.ruby-forum.com/t/colored-output-for-stories/128561)

<div class="topic-metadata">

**Author:** [@Neil\_MSYoung](https://www.ruby-forum.com/u/Neil_MSYoung)\
**Replies:** 3\
**Last updated:** [February 11, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/colored-output-for-stories/128561 "2008-02-11T15:07:55Z")

</div>

sorry if this is documented somewhere, but do stories support colored output? neither -c nor --color are working for me. View this message in context: http://www.nabble.com/colored-output-for-stories--tp15363648p1536…

---

## [Rspec - rails put :update any examples](https://www.ruby-forum.com/t/rspec-rails-put-update-any-examples/128130)

<div class="topic-metadata">

**Author:** [@circlefusion](https://www.ruby-forum.com/u/circlefusion)\
**Replies:** 5\
**Last updated:** [February 10, 2008, 2:03pm UTC](https://www.ruby-forum.com/t/rspec-rails-put-update-any-examples/128130 "2008-02-10T14:03:51Z")

</div>

I’m looking for a working example of a put :update on a controller. The documentation online avoids the update function. Any help pointing to this example would be great. Trying to get to 100% coverage…can’t make it…

---

## [Re: Shared examples not reloading in spec\_server](https://www.ruby-forum.com/t/re-shared-examples-not-reloading-in-spec-server/128641)

<div class="topic-metadata">

**Author:** [@charlesgreen](https://www.ruby-forum.com/u/charlesgreen)\
**Replies:** 0\
**Last updated:** [February 9, 2008, 7:56pm UTC](https://www.ruby-forum.com/t/re-shared-examples-not-reloading-in-spec-server/128641 "2008-02-09T19:56:12Z")

</div>

Hi, David, Thanks for the reply. I did try it with autotest only. The shared examples reloaded with each test run. I did some further investigation and sent an email to the dev mailing list with my findings and a …

---

## [Diff output "back to front"](https://www.ruby-forum.com/t/diff-output-back-to-front/128621)

<div class="topic-metadata">

**Author:** [@Wincent\_C](https://www.ruby-forum.com/u/Wincent_C)\
**Replies:** 1\
**Last updated:** [February 9, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/diff-output-back-to-front/128621 "2008-02-09T14:55:11Z")

</div>

Is it just me, or is the output of “spec --diff” “back to front”? In other words given expected result: foo 1 foo 2 foo 3 And actual result: foo 1 foo 2 bar x foo 3 This is what “spec --diff u the\_spec.rb” show…

---

## [Shared Examples + â€œinitialized c onstantâ€ warnings](https://www.ruby-forum.com/t/shared-examples-a-oeinitialized-c-onstanta-warnings/128501)

<div class="topic-metadata">

**Author:** [@Gerrit\_Kaiser](https://www.ruby-forum.com/u/Gerrit_Kaiser)\
**Replies:** 2\
**Last updated:** [February 9, 2008, 4:14am UTC](https://www.ruby-forum.com/t/shared-examples-a-oeinitialized-c-onstanta-warnings/128501 "2008-02-09T04:14:56Z")

</div>

Hi List, I’m using rspec’s shared example groups in a rails project (rails 2.02, rspec(on\_rails) 1.1.3) and I’m getting lots of errors of the following kind when(before) running the specs: (RAILS\_ROOT)/vendor/plugins…

---

## [RSS Validation matcher for RSpec/Rails](https://www.ruby-forum.com/t/rss-validation-matcher-for-rspec-rails/128552)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 6\
**Last updated:** [February 9, 2008, 12:55am UTC](https://www.ruby-forum.com/t/rss-validation-matcher-for-rspec-rails/128552 "2008-02-09T00:55:35Z")

</div>

As I posted to rails-talk yesterday, I whipped up an Rspec matcher using the feedvalidator gem, which lets you write response.should be\_valid\_feed in view specs or controller specs which integrate\_views I wrote about…

---

## [Can you explain this code to me?](https://www.ruby-forum.com/t/can-you-explain-this-code-to-me/128479)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 5\
**Last updated:** [February 8, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/can-you-explain-this-code-to-me/128479 "2008-02-08T22:34:33Z")

</div>

I am experimenting with the restful-authentication plug in and I see that it has generated an rspec encantation which I had not seen before: it ‘allows signup’ do lambda do create\_user response.should be\_redirect …

---

## [Template.expect\_render 'failure'](https://www.ruby-forum.com/t/template-expect-render-failure/128542)

<div class="topic-metadata">

**Author:** [@kevben](https://www.ruby-forum.com/u/kevben)\
**Replies:** 3\
**Last updated:** [February 8, 2008, 6:37pm UTC](https://www.ruby-forum.com/t/template-expect-render-failure/128542 "2008-02-08T18:37:51Z")

</div>

I keep having problems w/ expect\_render, mainly that it doesn’t work as advertised. I can put a template.expect\_render(:partial =\> ‘this should fail’) in a view spec and I get no failure. I have read the docs, I have …

---

## [Problems testing rss feed controller](https://www.ruby-forum.com/t/problems-testing-rss-feed-controller/128460)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 2\
**Last updated:** [February 7, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/problems-testing-rss-feed-controller/128460 "2008-02-07T21:40:02Z")

</div>

I’ve got a controller which produces an RSS feed, pretty much based on Ryan B. recent RailsCast. I’m having a heck of a time getting the spec to successfully fetch the feed though. I gave up got it working without a …

---

## [Shared examples not reloading in spec\_server](https://www.ruby-forum.com/t/shared-examples-not-reloading-in-spec-server/128425)

<div class="topic-metadata">

**Author:** [@charlesgreen](https://www.ruby-forum.com/u/charlesgreen)\
**Replies:** 1\
**Last updated:** [February 7, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/shared-examples-not-reloading-in-spec-server/128425 "2008-02-07T17:08:28Z")

</div>

I am currently running RSpec 1.1.3 with ZenTest 3.9.1 on Windows XP. I have noticed that shared examples are not being reloaded by spec\_server when they have been updated. Below is a simple example that reproduces t…

---

## [Rspec accessing the wrong id?](https://www.ruby-forum.com/t/rspec-accessing-the-wrong-id/128272)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 1\
**Last updated:** [February 7, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/rspec-accessing-the-wrong-id/128272 "2008-02-07T14:59:04Z")

</div>

Hi, This is probably straightforward to solve. I’m new to rspec so I hope you’ll be patient with me. I’ve created a model method which works in practice, but which rspec is not passing. I’m obviously not going about …

---

## [Outside-in BDD vs writing examples up front](https://www.ruby-forum.com/t/outside-in-bdd-vs-writing-examples-up-front/128094)

<div class="topic-metadata">

**Author:** [@dann](https://www.ruby-forum.com/u/dann)\
**Replies:** 1\
**Last updated:** [February 7, 2008, 9:45am UTC](https://www.ruby-forum.com/t/outside-in-bdd-vs-writing-examples-up-front/128094 "2008-02-07T09:45:33Z")

</div>

I thought I’d repost this because it had the not-very-obvious title of “Re: Textmate RSpec Bundle ‘it’ snippet”. And it seems quite timely wrt the BDD vs TDD threads. Cheers, Dan ps. Not wishing to single out Edva…

---

## [Trying to spec login requirement with a shared example](https://www.ruby-forum.com/t/trying-to-spec-login-requirement-with-a-shared-example/128366)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 1\
**Last updated:** [February 7, 2008, 4:40am UTC](https://www.ruby-forum.com/t/trying-to-spec-login-requirement-with-a-shared-example/128366 "2008-02-07T04:40:07Z")

</div>

In all of my controller specs I have tests that look something like this. it “should require login” do get :edit, :id =\> ‘7’ response.should redirect\_to(new\_session\_path) end I’d like to move this to a shared examp…

---

## [Rails rspec silently failing](https://www.ruby-forum.com/t/rails-rspec-silently-failing/128214)

<div class="topic-metadata">

**Author:** [@combray](https://www.ruby-forum.com/u/combray)\
**Replies:** 4\
**Last updated:** [February 6, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/rails-rspec-silently-failing/128214 "2008-02-06T17:28:28Z")

</div>

I’ve been beating my head against this for a couple of hours now, and I’m a bit frustrated, so I apologize in advance. I’m trying to use rspec to test an order processing system, which uses google checkout. The idea …

---

## [DRb does not activate using options file](https://www.ruby-forum.com/t/drb-does-not-activate-using-options-file/127645)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 1\
**Last updated:** [February 5, 2008, 10:23pm UTC](https://www.ruby-forum.com/t/drb-does-not-activate-using-options-file/127645 "2008-02-05T22:23:40Z")

</div>

Hello List, For a small project I’ve been using ‘ruby script/spec -X spec’ to execute my specs. Now that I added ZenTest on it, found that the test takes longer to run due the complete load of test environment. Sinc…

---

## [Spec::Runner.register\_at\_exit\_hook in RSpec 1.1.3](https://www.ruby-forum.com/t/spec-runner-register-at-exit-hook-in-rspec-1-1-3/128114)

<div class="topic-metadata">

**Author:** [@steveybaby](https://www.ruby-forum.com/u/steveybaby)\
**Replies:** 2\
**Last updated:** [February 5, 2008, 11:26am UTC](https://www.ruby-forum.com/t/spec-runner-register-at-exit-hook-in-rspec-1-1-3/128114 "2008-02-05T11:26:42Z")

</div>

In RSpec 1.1.3 this method is invoked from Spec::Example::ExampleGroupMethods.inherited, but it no longer exists. I noticed this trying to run my specs inside Textmate. I looked for a new version of the Textmate bundl…

---

## [Error on nil.build](https://www.ruby-forum.com/t/error-on-nil-build/128091)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 1\
**Last updated:** [February 5, 2008, 3:47am UTC](https://www.ruby-forum.com/t/error-on-nil-build/128091 "2008-02-05T03:47:08Z")

</div>

I can’t figure out why I am getting an error for one of the tests below: describe AccountsController, “POST” do before :each do @user = mock\_model(User) @account = mock\_model(Account, :id =\> 1, :valid =\> true, :save =\>…

---

## [Odd versioning issue](https://www.ruby-forum.com/t/odd-versioning-issue/128096)

<div class="topic-metadata">

**Author:** [@mattclarkson](https://www.ruby-forum.com/u/mattclarkson)\
**Replies:** 2\
**Last updated:** [February 5, 2008, 3:40am UTC](https://www.ruby-forum.com/t/odd-versioning-issue/128096 "2008-02-05T03:40:19Z")

</div>

Hi folks, If I run rspec from textmate, or do a "spec " from the command-line, I get this message: ############################################################################ Your RSpec on Rails plugin is incompatib…

---

## [Mock objects not getting unloaded between specs](https://www.ruby-forum.com/t/mock-objects-not-getting-unloaded-between-specs/128084)

<div class="topic-metadata">

**Author:** [@natec](https://www.ruby-forum.com/u/natec)\
**Replies:** 2\
**Last updated:** [February 5, 2008, 2:01am UTC](https://www.ruby-forum.com/t/mock-objects-not-getting-unloaded-between-specs/128084 "2008-02-05T02:01:11Z")

</div>

I’m having a frustrating experience with a mock object in one example (a Rails controller test) interfering with an actual model test in a subsequent model example. More specifically, I have spec/controllers/section\_…

---

## [Problems with plugins?](https://www.ruby-forum.com/t/problems-with-plugins/128076)

<div class="topic-metadata">

**Author:** [@lanceball](https://www.ruby-forum.com/u/lanceball)\
**Replies:** 3\
**Last updated:** [February 4, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/problems-with-plugins/128076 "2008-02-04T21:01:28Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there I’ve run into a bit of a problem that I can’t seem to figure out. I have a model class User which includes our acts\_as\_role\_context library. This lib acts lik…

---

## [BDD and TDD (was "Newbie question with rspec on rails")](https://www.ruby-forum.com/t/bdd-and-tdd-was-newbie-question-with-rspec-on-rails/128046)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 3\
**Last updated:** [February 4, 2008, 6:26pm UTC](https://www.ruby-forum.com/t/bdd-and-tdd-was-newbie-question-with-rspec-on-rails/128046 "2008-02-04T18:26:44Z")

</div>

On Feb 4, 2008 1:20 AM, Pat M. removed\_email\_address@domain.invalid wrote: For some info on why BDD kicks TDD’s butt … Woah! I find this deeply disturbing. I believe your heart is in the right place here, so please…

---

## [Re: RESTful Routes](https://www.ruby-forum.com/t/re-restful-routes/128055)

<div class="topic-metadata">

**Author:** [@voodoorai2000](https://www.ruby-forum.com/u/voodoorai2000)\
**Replies:** 1\
**Last updated:** [February 4, 2008, 6:13pm UTC](https://www.ruby-forum.com/t/re-restful-routes/128055 "2008-02-04T18:13:06Z")

</div>

On Feb 4, 2008 6:54 AM, Raimond G. removed\_email\_address@domain.invalid wrote: NoMethodError: You have a nil object when you didn’t expect it! The error occurred while evaluating nil.env Can you show the rest of the…

---

## [Development Cycle](https://www.ruby-forum.com/t/development-cycle/128006)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 3\
**Last updated:** [February 4, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/development-cycle/128006 "2008-02-04T17:10:28Z")

</div>

Hey guys, I’m trying to work out the order of development for features in an app. I’m struggling with using stories to drive development. So when looking at things, it seems to me to be the best idea to first write s…

---

## [Trouble testing a method with loop](https://www.ruby-forum.com/t/trouble-testing-a-method-with-loop/128030)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 4\
**Last updated:** [February 4, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/trouble-testing-a-method-with-loop/128030 "2008-02-04T16:21:45Z")

</div>

I’m having trouble working out how to test a method that contains a loop. I’m new to rspec so not sure what the best way is to tackle this. class Company \< ActiveRecord::Base def self.sync\_with\_basecamp companies = …

---

## [RESTful Routes](https://www.ruby-forum.com/t/restful-routes/128031)

<div class="topic-metadata">

**Author:** [@voodoorai2000](https://www.ruby-forum.com/u/voodoorai2000)\
**Replies:** 2\
**Last updated:** [February 4, 2008, 3:10pm UTC](https://www.ruby-forum.com/t/restful-routes/128031 "2008-02-04T15:10:12Z")

</div>

Hi, I’m trying to test the behavior of a route with a delete method. Something like this: When “the admin clicks on ‘delete’” do delete admin\_blog\_path(@blog) end which raises the following exception: NoMethodErro…

---

## [Newbie question with rspec on rails](https://www.ruby-forum.com/t/newbie-question-with-rspec-on-rails/128012)

<div class="topic-metadata">

**Author:** [@rick](https://www.ruby-forum.com/u/rick)\
**Replies:** 2\
**Last updated:** [February 4, 2008, 8:39am UTC](https://www.ruby-forum.com/t/newbie-question-with-rspec-on-rails/128012 "2008-02-04T08:39:08Z")

</div>

Hi, I’m just startingwith Rspec with the rails framework. I have a question regarding contexts. If I use a generator for a model, for example, user, I get a user\_spec which I can place rspec specs. Should I be only…

---

## [Specing dynamic routes](https://www.ruby-forum.com/t/specing-dynamic-routes/127987)

<div class="topic-metadata">

**Author:** [@Tye\_Shavik](https://www.ruby-forum.com/u/Tye_Shavik)\
**Replies:** 0\
**Last updated:** [February 3, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/specing-dynamic-routes/127987 "2008-02-03T22:15:57Z")

</div>

Hi, I dynamically generating routes and I’m running into trouble specing due to isolation. I need to know if there is a way to mock routes, I tried but not sure how to approach it. Let me describe what I’m attemptin…

---

## ["once" not honored?](https://www.ruby-forum.com/t/once-not-honored/127982)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [February 3, 2008, 8:23pm UTC](https://www.ruby-forum.com/t/once-not-honored/127982 "2008-02-03T20:23:35Z")

</div>

I’m trying this: firmware.should\_receive(:execute).with(“ATZ”).once.ordered.and\_return(AT\_OK) firmware.should\_receive(:execute).with(“ATE0V1”).once.ordered.and\_return(AT\_OK) firmware.should\_receive(:execute).with(“AT+…

---

## [Loading fixtures?](https://www.ruby-forum.com/t/loading-fixtures/127754)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 6\
**Last updated:** [February 2, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/loading-fixtures/127754 "2008-02-02T14:45:49Z")

</div>

How do you load fixtures from specs as you would test? eg. rake db:fixtures:load RAILS\_ENV=development

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

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