# RSpec

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

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

---

## [Build rspec-rails as a gem?](https://www.ruby-forum.com/t/build-rspec-rails-as-a-gem/139359)

<div class="topic-metadata">

**Author:** [@jfernandez](https://www.ruby-forum.com/u/jfernandez)\
**Replies:** 9\
**Last updated:** [June 3, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/build-rspec-rails-as-a-gem/139359 "2008-06-03T19:02:42Z")

</div>

I can’t figure out how to build rspec-rails as a gem when just cloned from github… there isn’t any .gemspec file or rake task that does this. Any help?

---

## [Pretty HTML reporting for stories](https://www.ruby-forum.com/t/pretty-html-reporting-for-stories/139304)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 7\
**Last updated:** [June 3, 2008, 7:43am UTC](https://www.ruby-forum.com/t/pretty-html-reporting-for-stories/139304 "2008-06-03T07:43:52Z")

</div>

Hi all, I’m just getting to grips with rspec, and I’m trying to put together a showy demo. We’re trying to use the (plain text) stories feature, rather than the specs. I’d like to show off a fancy HTML report of the r…

---

## [Cannot log in/authenticate within RSpec Story](https://www.ruby-forum.com/t/cannot-log-in-authenticate-within-rspec-story/139336)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 2\
**Last updated:** [June 3, 2008, 1:54am UTC](https://www.ruby-forum.com/t/cannot-log-in-authenticate-within-rspec-story/139336 "2008-06-03T01:54:51Z")

</div>

I’ve been slamming my head against a wall for a while now, and would like some help. I believe this is session related. I have a story that looks like: Given that a post exists And I am logged in When I visit the po…

---

## [Looking for help on two issues with Rails 2.1 and RSpec 1.14](https://www.ruby-forum.com/t/looking-for-help-on-two-issues-with-rails-2-1-and-rspec-1-14/139315)

<div class="topic-metadata">

**Author:** [@stevedogers](https://www.ruby-forum.com/u/stevedogers)\
**Replies:** 1\
**Last updated:** [June 2, 2008, 11:27pm UTC](https://www.ruby-forum.com/t/looking-for-help-on-two-issues-with-rails-2-1-and-rspec-1-14/139315 "2008-06-02T23:27:21Z")

</div>

I have specs that ran fine in Rails 2.02/RSpec 1.13 that are failing on Rails 2.1/RSpec 1.14. There is one problem and one issue: problem: sometimes (but not always) I get a NoMethodError referencing a has\_many assoc…

---

## [Get method under 1.1.4 in Stories is undefined](https://www.ruby-forum.com/t/get-method-under-1-1-4-in-stories-is-undefined/139302)

<div class="topic-metadata">

**Author:** [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Replies:** 2\
**Last updated:** [June 2, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/get-method-under-1-1-4-in-stories-is-undefined/139302 "2008-06-02T20:56:26Z")

</div>

HI, After I upgraded to RSpec 1.1.4 (from git), my stories all failed. I was using Webrat and the first thing I noticed was the ‘visits’ method was gone. I then backtracked to just using ‘get’ and got the same undefi…

---

## [Cherry-picking mocks?!](https://www.ruby-forum.com/t/cherry-picking-mocks/139309)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 1\
**Last updated:** [June 2, 2008, 8:51pm UTC](https://www.ruby-forum.com/t/cherry-picking-mocks/139309 "2008-06-02T20:51:43Z")

</div>

A colleague just came in and asked me about a problem he was having with stub\_render, which reminded me of another issue he had a week or so ago, which seems related. Let me start with the earlier issue. He was tryin…

---

## [!= again](https://www.ruby-forum.com/t/again/139208)

<div class="topic-metadata">

**Author:** [@Matthias\_Hennemeyer](https://www.ruby-forum.com/u/Matthias_Hennemeyer)\
**Replies:** 6\
**Last updated:** [June 2, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/again/139208 "2008-06-02T20:03:59Z")

</div>

Hey! I have implemented a quick solution for the should != … , should ! ~ … ‘problem’. It uses source code inspection (I think it’s the only way) and i’ve done some benchmarking to see if it’s really that slow. A d…

---

## [Getting annotations in spec files](https://www.ruby-forum.com/t/getting-annotations-in-spec-files/139227)

<div class="topic-metadata">

**Author:** [@T\_K](https://www.ruby-forum.com/u/T_K)\
**Replies:** 1\
**Last updated:** [June 2, 2008, 12:53pm UTC](https://www.ruby-forum.com/t/getting-annotations-in-spec-files/139227 "2008-06-02T12:53:12Z")

</div>

Hi, I just noticed that rake notes in rails 2.0.2 doesn’t check spec directory. So, what I annotated with “FIXME”, “TODO” and “OPTIMIZE” on \*\_spec.rb are discarded. Is there any quick way to rake notes task to check s…

---

## [Railsconf and textmate bundle for Story Runner](https://www.ruby-forum.com/t/railsconf-and-textmate-bundle-for-story-runner/139184)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 0\
**Last updated:** [June 1, 2008, 12:20pm UTC](https://www.ruby-forum.com/t/railsconf-and-textmate-bundle-for-story-runner/139184 "2008-06-01T12:20:50Z")

</div>

Hey guys, A friend and I have been working on a textmate bundle for the story runner while up here at railsconf. It is still pretty new but we think it already has some very helpful features that removes some of the…

---

## [Mixing mocking frameworks?](https://www.ruby-forum.com/t/mixing-mocking-frameworks/139180)

<div class="topic-metadata">

**Author:** [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Replies:** 0\
**Last updated:** [June 1, 2008, 6:21am UTC](https://www.ruby-forum.com/t/mixing-mocking-frameworks/139180 "2008-06-01T06:21:10Z")

</div>

First, it was great meeting a bunch of you at RailsConf. Recently I’ve run into a problem using RSpec, namely its support for multiple mocking frameworks. Wait you say, isn’t that a good thing? Yes, it is until you en…

---

## [Any good Rails example app created with RSpec and Rspec on Rails?](https://www.ruby-forum.com/t/any-good-rails-example-app-created-with-rspec-and-rspec-on-rails/139057)

<div class="topic-metadata">

**Author:** [@T\_K](https://www.ruby-forum.com/u/T_K)\
**Replies:** 2\
**Last updated:** [May 30, 2008, 5:22pm UTC](https://www.ruby-forum.com/t/any-good-rails-example-app-created-with-rspec-and-rspec-on-rails/139057 "2008-05-30T17:22:36Z")

</div>

Hi, I’m pretty new to RSpec. I’ve been browsing http://opensourcerails.com to find a good app built using RSpec (and RSpec on Rails). Does anybody have a recommendation? I wanna see example of mocks/stubs, associated…

---

## [Coloured output in rspec 1.1.4](https://www.ruby-forum.com/t/coloured-output-in-rspec-1-1-4/138950)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 9\
**Last updated:** [May 29, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/coloured-output-in-rspec-1-1-4/138950 "2008-05-29T15:36:44Z")

</div>

Hello. I have lost the coloured output in autotest after updating to rspec v1.1.4 I was already using the edge version and was ok then, before the last update. Anyone knows something about this? Thank you.

---

## [How to write spec for infinite loop?](https://www.ruby-forum.com/t/how-to-write-spec-for-infinite-loop/138944)

<div class="topic-metadata">

**Author:** [@zuo\_peng](https://www.ruby-forum.com/u/zuo_peng)\
**Replies:** 7\
**Last updated:** [May 29, 2008, 11:13am UTC](https://www.ruby-forum.com/t/how-to-write-spec-for-infinite-loop/138944 "2008-05-29T11:13:16Z")

</div>

Hi, I’ve got trouble when describe infinite loop. code snippet: def start\_loop while true data = self.server.handle\_client if data self.manager.dispatch(data) end end end without the loop, it is easy to test t…

---

## [Permission error when installing rspec](https://www.ruby-forum.com/t/permission-error-when-installing-rspec/138812)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [May 28, 2008, 8:47pm UTC](https://www.ruby-forum.com/t/permission-error-when-installing-rspec/138812 "2008-05-28T20:47:44Z")

</div>

hello from here! i’m new in rspec and i have a problem while installing rspec 1.1.4 gem: marcio@marcio-work:~$ gem install rspec Bulk updating Gem source index for: http://gems.rubyforge.org ERROR: While executing g…

---

## [Failing rspec story not causing a CruiseC ontrol.rb build to fail?](https://www.ruby-forum.com/t/failing-rspec-story-not-causing-a-cruisec-ontrol-rb-build-to-fail/138783)

<div class="topic-metadata">

**Author:** [@seanmctex](https://www.ruby-forum.com/u/seanmctex)\
**Replies:** 4\
**Last updated:** [May 27, 2008, 11:02pm UTC](https://www.ruby-forum.com/t/failing-rspec-story-not-causing-a-cruisec-ontrol-rb-build-to-fail/138783 "2008-05-27T23:02:37Z")

</div>

We’ve just added rspec stories to our CruiseControl.rb build. When there’s a failing scenario we see the failure in the log output, but it doesn’t cause the CruiseControl build to fail. We’ve also just upgraded to t…

---

## [Modules will no longer be automatically included in RSpec version 1.1.4](https://www.ruby-forum.com/t/modules-will-no-longer-be-automatically-included-in-rspec-version-1-1-4/138525)

<div class="topic-metadata">

**Author:** [@Lori\_M\_Olson](https://www.ruby-forum.com/u/Lori_M_Olson)\
**Replies:** 12\
**Last updated:** [May 27, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/modules-will-no-longer-be-automatically-included-in-rspec-version-1-1-4/138525 "2008-05-27T16:37:32Z")

</div>

Can anyone (David?) shed some light on what exactly this warning is complaining about? I started seeing it when I upgraded to Rails 2.1 RC1 and the latest RSpec from git. I’m getting it in some helper specs that I’m …

---

## [Testing rails plugins standalone](https://www.ruby-forum.com/t/testing-rails-plugins-standalone/138757)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 1\
**Last updated:** [May 27, 2008, 4:22pm UTC](https://www.ruby-forum.com/t/testing-rails-plugins-standalone/138757 "2008-05-27T16:22:46Z")

</div>

I’d like to finally get started with RSpec, however, not on a complete (rails or whatever) application, but only on a single rails plugin. In particular, I want to test the plugin without the context of a specific rai…

---

## [Re: new --pattern option](https://www.ruby-forum.com/t/re-new-pattern-option/138731)

<div class="topic-metadata">

**Author:** [@kasutaja](https://www.ruby-forum.com/u/kasutaja)\
**Replies:** 8\
**Last updated:** [May 27, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/re-new-pattern-option/138731 "2008-05-27T16:21:35Z")

</div>

Hello. You’re saying that: To get rspec to behave as it did before this change, use this: –pattern “\*\*/\*.rb” I tried like this (rspec 1.03) and it wasn’t same as before (rspec 1.08). Now it also loads all other fil…

---

## [Help with Writing Meaningful Specs](https://www.ruby-forum.com/t/help-with-writing-meaningful-specs/138753)

<div class="topic-metadata">

**Author:** [@andypearson](https://www.ruby-forum.com/u/andypearson)\
**Replies:** 2\
**Last updated:** [May 27, 2008, 2:27pm UTC](https://www.ruby-forum.com/t/help-with-writing-meaningful-specs/138753 "2008-05-27T14:27:27Z")

</div>

Hello all, In yet another attempt to learn Ruby on Rails and Rspec I have started writing a simple life streaming app with will aggregate feeds from several places and save them in a database for later use. An inter…

---

## [\[ANN\] RSpec-1.1.4](https://www.ruby-forum.com/t/ann-rspec-1-1-4/138701)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 2\
**Last updated:** [May 27, 2008, 1:15pm UTC](https://www.ruby-forum.com/t/ann-rspec-1-1-4/138701 "2008-05-27T13:15:45Z")

</div>

The RSpec Development Team is happy to announce the release of RSpec-1.1.4. See http://rspec.info/changes.html for details of what changed in this release. For Rails developers: This release of RSpec supports Rails…

---

## [Mocking Models in Controller Specs](https://www.ruby-forum.com/t/mocking-models-in-controller-specs/138695)

<div class="topic-metadata">

**Author:** [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Replies:** 7\
**Last updated:** [May 27, 2008, 11:38am UTC](https://www.ruby-forum.com/t/mocking-models-in-controller-specs/138695 "2008-05-27T11:38:26Z")

</div>

I find myself doing this kind of thing a lot in Controller Specs: @vacancy = mock\_model(Vacancy) @vacancy.stub!(:reference) @vacancy.stub!(:title) @vacancy.stub!(:created\_at) @vacancy.stub!(:updated\_at) @vac…

---

## [Re: RailsExampleGroup](https://www.ruby-forum.com/t/re-railsexamplegroup/138519)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 1\
**Last updated:** [May 23, 2008, 11:28pm UTC](https://www.ruby-forum.com/t/re-railsexamplegroup/138519 "2008-05-23T23:28:14Z")

</div>

Well, I use this for driving selenium RC. So the approach I am using is to setup some data, and then invoke selenium to interact with a test server. Apparently the test server uses another connection. Would you sugges…

---

## [View Specs vs. Stories](https://www.ruby-forum.com/t/view-specs-vs-stories/138507)

<div class="topic-metadata">

**Author:** [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Replies:** 10\
**Last updated:** [May 23, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/view-specs-vs-stories/138507 "2008-05-23T23:18:49Z")

</div>

Do RSpec stories make view specs redundant? Does anybody spec their views and use stories, and if so how? Any views (no pun intended) appreciated. ~ Thanks Mark

---

## [RailsExampleGroup](https://www.ruby-forum.com/t/railsexamplegroup/138510)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 1\
**Last updated:** [May 23, 2008, 9:24pm UTC](https://www.ruby-forum.com/t/railsexamplegroup/138510 "2008-05-23T21:24:08Z")

</div>

So I have a describe which is a subclass of RailsExampleGroup. I inserted some data into my database, and reconnect! my connection. Before reconnect, finding the data I just created is fine. The data cannot be found,…

---

## [Error when trying to get the install RSpec from Github](https://www.ruby-forum.com/t/error-when-trying-to-get-the-install-rspec-from-github/138476)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 2\
**Last updated:** [May 23, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/error-when-trying-to-get-the-install-rspec-from-github/138476 "2008-05-23T15:02:47Z")

</div>

Hi – I’ve tried to get the latest RSpec by following the instructions at: GitHub - dchelimsky/rspec: Behaviour Driven Development framework for Ruby I clone the repository just fine, but then, when I ‘rake gem’, I get…

---

## [Is there an equivalent to anything() for Hash parameters?](https://www.ruby-forum.com/t/is-there-an-equivalent-to-anything-for-hash-parameters/138475)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 4\
**Last updated:** [May 23, 2008, 12:20pm UTC](https://www.ruby-forum.com/t/is-there-an-equivalent-to-anything-for-hash-parameters/138475 "2008-05-23T12:20:50Z")

</div>

Hi – is there an equivalent to the anything() method to use with Hash parameters? So that the following call: Model.find( :all, :conditions =\> “name LIKE ‘%rt%’”, :order =\> ‘name’ ) Could have the two following succ…

---

## [Specifying certain tables NOT to be cleared each example?](https://www.ruby-forum.com/t/specifying-certain-tables-not-to-be-cleared-each-example/138336)

<div class="topic-metadata">

**Author:** [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Replies:** 14\
**Last updated:** [May 22, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/specifying-certain-tables-not-to-be-cleared-each-example/138336 "2008-05-22T17:28:41Z")

</div>

Is it possible to specify that certain tables not be cleared on each example. I’ve inherited a project where a good amount of enumerated data is stored in the database (US States, statuses, about 15-20 tables worth. …

---

## [Testing REST webservices? (Not Rails)](https://www.ruby-forum.com/t/testing-rest-webservices-not-rails/138310)

<div class="topic-metadata">

**Author:** [@eterps](https://www.ruby-forum.com/u/eterps)\
**Replies:** 1\
**Last updated:** [May 22, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/testing-rest-webservices-not-rails/138310 "2008-05-22T12:47:19Z")

</div>

Hi, I am new to RSpec and BDD. I was wondering if RSpec specifications are a good solution for testing REST webservices (not implemented in Rails). If so, what would be a good way to test something like the API descr…

---

## [Re: running rspec on 1.2.3?](https://www.ruby-forum.com/t/re-running-rspec-on-1-2-3/138279)

<div class="topic-metadata">

**Author:** [@ldk2005](https://www.ruby-forum.com/u/ldk2005)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/re-running-rspec-on-1-2-3/138279 "2008-05-21T17:01:56Z")

</div>

Hi David, Thank you for your response. Got it working: The rspec\_on\_rails was not being loaded because it appeared in the line config.plugins -= %W( query\_trace … } # plugins that should NOT be loaded in the file …

---

## [Re: TextMate bundle not using environment variable to	find Ruby library](https://www.ruby-forum.com/t/re-textmate-bundle-not-using-environment-variable-to-find-ruby-library/138273)

<div class="topic-metadata">

**Author:** [@SoManyFishes](https://www.ruby-forum.com/u/SoManyFishes)\
**Replies:** 0\
**Last updated:** [May 21, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/re-textmate-bundle-not-using-environment-variable-to-find-ruby-library/138273 "2008-05-21T16:27:09Z")

</div>

Something is going on in my TextMate bundle–it’s calling the wrong lib for Ruby. I have the environment variables set like this: TM\_RSPEC\_HOME /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.3 TM\_RUBY /usr/local/bin/r…

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

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