# RSpec

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

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

---

## [Rescuing a Test-Free Project with RSpec and Cucumber](https://www.ruby-forum.com/t/rescuing-a-test-free-project-with-rspec-and-cucumber/200438)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 3\
**Last updated:** [December 11, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/rescuing-a-test-free-project-with-rspec-and-cucumber/200438 "2010-12-11T20:32:55Z")

</div>

Hi all, I was recently brought onto a Rails 2.2.3 project which was itself an emergency rescue of a spaghetti-coded PHP project (complete with hard-coded SQL statements!). Due to the fact that the code was already i…

---

## [RSpec2 not supported in Netbeans](https://www.ruby-forum.com/t/rspec2-not-supported-in-netbeans/200396)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [December 10, 2010, 8:49pm UTC](https://www.ruby-forum.com/t/rspec2-not-supported-in-netbeans/200396 "2010-12-10T20:49:52Z")

</div>

Hi All, RSpec2 doesn’t seem to be supported in Netbeans. When I try to run RSpec in Netbeans, it says the command ‘spec’ not found. Does anybody have any information if this will be corrected? Thanks, Babitha

---

## [Transactional fixtures for Gem (not Rails) development](https://www.ruby-forum.com/t/transactional-fixtures-for-gem-not-rails-development/200386)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 10, 2010, 2:01pm UTC](https://www.ruby-forum.com/t/transactional-fixtures-for-gem-not-rails-development/200386 "2010-12-10T14:01:25Z")

</div>

Hello. Is it possible to also use the transactional examples feature for gem (not Rails) development. It seems that one has to require “rspec- rails”, but I still can’t get it to work. I added this to my spec\_helper.…

---

## [Displaying a note or comment when --format doc](https://www.ruby-forum.com/t/displaying-a-note-or-comment-when-format-doc/200336)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 9, 2010, 2:40pm UTC](https://www.ruby-forum.com/t/displaying-a-note-or-comment-when-format-doc/200336 "2010-12-09T14:40:43Z")

</div>

I’m new to rspec, so, I might be coloring outside the lines, but, there have been several instances where I have wanted to display a comment or note. for example: describe “truck” do it “should require model” do en…

---

## [Controller specs for sub-controllers](https://www.ruby-forum.com/t/controller-specs-for-sub-controllers/200171)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 8, 2010, 8:14pm UTC](https://www.ruby-forum.com/t/controller-specs-for-sub-controllers/200171 "2010-12-08T20:14:39Z")

</div>

I’m completely new to RSpec (and fairly new to Rails, too.) I’m working on an existing application that has an Admin::BaseController and sub-controllers such as Admin:TestimonialsController: class Admin::BaseControlle…

---

## [Mocking a Model Class and a View with RSpec-Rails](https://www.ruby-forum.com/t/mocking-a-model-class-and-a-view-with-rspec-rails/200269)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 8, 2010, 8:03pm UTC](https://www.ruby-forum.com/t/mocking-a-model-class-and-a-view-with-rspec-rails/200269 "2010-12-08T20:03:17Z")

</div>

Hi all, I’m new to RSpec and to TDD/Agile methods in general (by “new” I mean I’m about 4/5 of the way through The RSpec Book and haven’t yet actually implemented the practices in my projects), so this question may s…

---

## [Unexpected before :each behavior](https://www.ruby-forum.com/t/unexpected-before-each-behavior/200207)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 7, 2010, 4:31am UTC](https://www.ruby-forum.com/t/unexpected-before-each-behavior/200207 "2010-12-07T04:31:23Z")

</div>

Hi gang. I’ve come across what I believe to be unexpected behavior for some of my before :each blocks, and I wonder if anyone can enlighten me as to why this is happening. The surprising thing happens when I run a ‘…

---

## [Change setting to receive emails when posted?](https://www.ruby-forum.com/t/change-setting-to-receive-emails-when-posted/200204)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [December 7, 2010, 1:49am UTC](https://www.ruby-forum.com/t/change-setting-to-receive-emails-when-posted/200204 "2010-12-07T01:49:50Z")

</div>

This is an administrative question: I joined this group yesterday and when I try to save my preferences it does not allow me to select “Email (approximately 12 emails per day)”… is it just me or does everyone just g…

---

## [Problem with 1.9.2](https://www.ruby-forum.com/t/problem-with-1-9-2/200198)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 7, 2010, 12:31am UTC](https://www.ruby-forum.com/t/problem-with-1-9-2/200198 "2010-12-07T00:31:46Z")

</div>

Hi guys, I’m not entirely sure this is a problem with RSpec or cucumber, for sure it’s happening after the last gem update under 1.9.2 (rvm). Backtrace: gist:730995 · GitHub Gemfile: gist:730999 · GitHub I’ve tried t…

---

## [Rspec: \`should': uninitialized constant RSpec::Expectations (NameError)](https://www.ruby-forum.com/t/rspec-should-uninitialized-constant-rspec-expectations-nameerror/200143)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 4\
**Last updated:** [December 6, 2010, 9:06pm UTC](https://www.ruby-forum.com/t/rspec-should-uninitialized-constant-rspec-expectations-nameerror/200143 "2010-12-06T21:06:30Z")

</div>

Hi all, anyone have an idea why I am getting an error trying to ‘rake spec’: ‘kernel.rb:27:in \`should’: uninitialized constant RSpec::Expectations (NameError)’. Can’t seem to find a useful reference online to solve. …

---

## [RSpec 2.1.0 Start up problems](https://www.ruby-forum.com/t/rspec-2-1-0-start-up-problems/200144)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [December 6, 2010, 11:56am UTC](https://www.ruby-forum.com/t/rspec-2-1-0-start-up-problems/200144 "2010-12-06T11:56:34Z")

</div>

I have a simple model as shown below: == Schema Information Schema version: 20101101014544 Table name: base\_folders id :integer not null, primary key name :string(255) created\_at :datetime update…

---

## [\[Sinatra\] "tried to create Proc object without a block"](https://www.ruby-forum.com/t/sinatra-tried-to-create-proc-object-without-a-block/199760)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 7\
**Last updated:** [December 5, 2010, 10:04pm UTC](https://www.ruby-forum.com/t/sinatra-tried-to-create-proc-object-without-a-block/199760 "2010-12-05T22:04:30Z")

</div>

Hello all, I’m a long time Ruby and Rails user, but new to RSpec; I’ve been using Shoulda instead. I picked up the book “Service-Oriented Design with Ruby and Rails” (Amazon.com) which uses RSpec throughout. Despite …

---

## [Controller\_name replacement?](https://www.ruby-forum.com/t/controller-name-replacement/200084)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 4, 2010, 5:40pm UTC](https://www.ruby-forum.com/t/controller-name-replacement/200084 "2010-12-04T17:40:52Z")

</div>

This his been discussed but the only definitive answer (kinda) was use… describe “a description” do system { SomeController } end However when I do that I get this error… @controller is nil: make sure you set it in…

---

## [Speccing a model class method in Rails produces nil](https://www.ruby-forum.com/t/speccing-a-model-class-method-in-rails-produces-nil/200048)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 5\
**Last updated:** [December 4, 2010, 5:39pm UTC](https://www.ruby-forum.com/t/speccing-a-model-class-method-in-rails-produces-nil/200048 "2010-12-04T17:39:35Z")

</div>

Ruby 1.9.2, Rails 3.0.3, Rspec-rails 2.2.0 I have: Factory.define :season\_date do |f| f.season\_date Date.new(2011,9,24) f.date\_type “season\_start” end RSpec.configure do |config| config.mock\_with :rspec end Fact…

---

## [Metadata about formatter being used accessible in spec?](https://www.ruby-forum.com/t/metadata-about-formatter-being-used-accessible-in-spec/200067)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 4, 2010, 4:12am UTC](https://www.ruby-forum.com/t/metadata-about-formatter-being-used-accessible-in-spec/200067 "2010-12-04T04:12:49Z")

</div>

Is it possible to read which formatter is being used? For instance if - f d is used to output additional information or is there a better way to do that?

---

## [\[rspec-rails\] Configuring which ExampleGroup gets instantiated](https://www.ruby-forum.com/t/rspec-rails-configuring-which-examplegroup-gets-instantiated/200073)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [December 4, 2010, 3:54am UTC](https://www.ruby-forum.com/t/rspec-rails-configuring-which-examplegroup-gets-instantiated/200073 "2010-12-04T03:54:41Z")

</div>

Hi all, I’ve spent a fair bit of time googling but couldn’t find the answer to this question. Any insight would be greatly appreciated. Basically I’m specking my ActionMailer instance & I would like to use Controller…

---

## [Meaningless stacktrace on RSpec error (no line of error)](https://www.ruby-forum.com/t/meaningless-stacktrace-on-rspec-error-no-line-of-error/200065)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 4, 2010, 3:41am UTC](https://www.ruby-forum.com/t/meaningless-stacktrace-on-rspec-error-no-line-of-error/200065 "2010-12-04T03:41:33Z")

</div>

Hi all, I am new to RSpec, currently using rspec-rails (2.1.0) with rails (2.2.3) and ruby (1.8.7). I can get RSpec running however the stacktrace when it happened is pretty uninformative, always not including the li…

---

## [Rspec2 and autotest](https://www.ruby-forum.com/t/rspec2-and-autotest/200066)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 4, 2010, 3:36am UTC](https://www.ruby-forum.com/t/rspec2-and-autotest/200066 "2010-12-04T03:36:32Z")

</div>

David: Glad to see that your book was just published. It’s been a life-changing read! I’m struggling with the best way to integrate autotest working in a rails project with RSpec 2. The latest autotest 4.4.6 gem seem…

---

## [Global before blocks - filtering by multiple types](https://www.ruby-forum.com/t/global-before-blocks-filtering-by-multiple-types/200064)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 4, 2010, 3:36am UTC](https://www.ruby-forum.com/t/global-before-blocks-filtering-by-multiple-types/200064 "2010-12-04T03:36:32Z")

</div>

Hi in the config block of rspec I have a before block to reset my database before each spec: config.before(:each) {DatabaseCleaner.clean} I know I can apply this before to a specific type, e.g. config.before(:each, …

---

## [How can I use nested "before" functions?](https://www.ruby-forum.com/t/how-can-i-use-nested-before-functions/200070)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 3\
**Last updated:** [December 4, 2010, 3:36am UTC](https://www.ruby-forum.com/t/how-can-i-use-nested-before-functions/200070 "2010-12-04T03:36:32Z")

</div>

Hi everyone, I’ve started learning Ruby and RSpec, and I’ve ran into a small problem. I have one “before” functions which run before all my descriptions and the context in the spec, and then I have another “before” f…

---

## [Routes are not recognized in request specs after upgrading to 2.2](https://www.ruby-forum.com/t/routes-are-not-recognized-in-request-specs-after-upgrading-to-2-2/229182)

<div class="topic-metadata">

**Author:** [@ESLitwin](https://www.ruby-forum.com/u/ESLitwin)\
**Replies:** 1\
**Last updated:** [December 4, 2010, 3:35am UTC](https://www.ruby-forum.com/t/routes-are-not-recognized-in-request-specs-after-upgrading-to-2-2/229182 "2010-12-04T03:35:54Z")

</div>

I’m getting undefined local variable or method \`users\_path’ (as an example) my request spec tests after upgrading to 2.2.0 from 2.1.0. I haven’t really changed these tests from the generated code but am curious as to …

---

## [Routes are not recognized in request specs after upgrading to 2.2](https://www.ruby-forum.com/t/routes-are-not-recognized-in-request-specs-after-upgrading-to-2-2/226104)

<div class="topic-metadata">

**Author:** [@ESLitwin](https://www.ruby-forum.com/u/ESLitwin)\
**Replies:** 0\
**Last updated:** [December 4, 2010, 12:47am UTC](https://www.ruby-forum.com/t/routes-are-not-recognized-in-request-specs-after-upgrading-to-2-2/226104 "2010-12-04T00:47:41Z")

</div>

I’m getting undefined local variable or method \`users\_path’ (as an example) my request spec tests after upgrading to 2.2.0 from 2.1.0. I haven’t really changed these tests from the generated code but am curious as to …

---

## [Routes are not recognized in request specs after upgrading to 2.2](https://www.ruby-forum.com/t/routes-are-not-recognized-in-request-specs-after-upgrading-to-2-2/200062)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [December 4, 2010, 12:43am UTC](https://www.ruby-forum.com/t/routes-are-not-recognized-in-request-specs-after-upgrading-to-2-2/200062 "2010-12-04T00:43:57Z")

</div>

I’m getting undefined local variable or method \`users\_path’ (as an example) my request spec tests after upgrading to 2.2.0 from 2.1.0. I haven’t really changed these tests from the generated code but am curious as to …

---

## [Stub! does not work](https://www.ruby-forum.com/t/stub-does-not-work/200041)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 3, 2010, 1:28pm UTC](https://www.ruby-forum.com/t/stub-does-not-work/200041 "2010-12-03T13:28:01Z")

</div>

Hi, This piece of code does not work. Does anybody know the cause? describe “/loan-events/{source-id}-lend.json” do describe “GET” do it “should call all method of LoanEvent with source\_id” do source\_id = rand(1000) …

---

## [Re: Failing View Spec, rspec-rails 2.2.1](https://www.ruby-forum.com/t/re-failing-view-spec-rspec-rails-2-2-1/200021)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [December 3, 2010, 12:27am UTC](https://www.ruby-forum.com/t/re-failing-view-spec-rspec-rails-2-2-1/200021 "2010-12-03T00:27:02Z")

</div>

David, Sorry, I didn’t specify what the url was for! That was the url to pull from, not the github page… Github Page: https://github.com/matthewcalebsmith/rspec\_issue git clone: https://github.com/matthewcalebsmith…

---

## [Configuration options](https://www.ruby-forum.com/t/configuration-options/200006)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [December 2, 2010, 9:28pm UTC](https://www.ruby-forum.com/t/configuration-options/200006 "2010-12-02T21:28:14Z")

</div>

is there a listing of the Spec::Runner configuration options somewhere? I’m looking for a document (code is ok) that lists all the available options and their purpose. example, I can see from my code that these exis…

---

## [RSpec 2.x and bundler](https://www.ruby-forum.com/t/rspec-2-x-and-bundler/199996)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [December 2, 2010, 5:08pm UTC](https://www.ruby-forum.com/t/rspec-2-x-and-bundler/199996 "2010-12-02T17:08:37Z")

</div>

I use bundler to create and manage my own Ruby gems. I recently stumble upon this really weird behaviour. If I just do “rspec spec/\*” then everything is fine. If I “take test\_specs”, it complains that Article (see …

---

## [Rspec-rails-2.2.1 is released!](https://www.ruby-forum.com/t/rspec-rails-2-2-1-is-released/199925)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [December 1, 2010, 3:26pm UTC](https://www.ruby-forum.com/t/rspec-rails-2-2-1-is-released/199925 "2010-12-01T15:26:43Z")

</div>

rspec-rails-2.2.1 / 2010-12-01 full changelog Bug fixes Depend on railties, activesupport, and actionpack instead of rails (Piotr Solnica) Got webrat integration working properly across different types of specs …

---

## [ActionController::RoutingError Assistance](https://www.ruby-forum.com/t/actioncontroller-routingerror-assistance/199864)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [December 1, 2010, 2:29pm UTC](https://www.ruby-forum.com/t/actioncontroller-routingerror-assistance/199864 "2010-12-01T14:29:06Z")

</div>

Hello everyone, I can’t seem to figure out what I’m doing wrong on this test. I’m trying to delete one of my models, criterion. All code can be found here, please let me know if you need anything else! The rspec messa…

---

## [Re: RSpec interacting with Test::Unit: weird "is already defined" error](https://www.ruby-forum.com/t/re-rspec-interacting-with-test-weird-is-already-defined-error/199901)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [December 1, 2010, 6:56am UTC](https://www.ruby-forum.com/t/re-rspec-interacting-with-test-weird-is-already-defined-error/199901 "2010-12-01T06:56:22Z")

</div>

Jo, You may look at shoulda if you want to continue to use test unit but want some of the feel of rspec. Good luck Jed Sent from my iPad

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

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