# RSpec

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

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

---

## [CRITICAL: Rspec gem install \> spec command not found!](https://www.ruby-forum.com/t/critical-rspec-gem-install-spec-command-not-found/182761)

<div class="topic-metadata">

**Author:** [@kristianm](https://www.ruby-forum.com/u/kristianm)\
**Replies:** 2\
**Last updated:** [February 3, 2010, 10:08am UTC](https://www.ruby-forum.com/t/critical-rspec-gem-install-spec-command-not-found/182761 "2010-02-03T10:08:32Z")

</div>

I have the beta release of the RSpec book. Trying to run the greeting example ‘Hello World’ Using brew as package manager Installed rspec gem using $ sudo gem install rspec kristian-mandrups-macbook-pro:rspec-coding…

---

## [Message expectation that verifies result of passed block](https://www.ruby-forum.com/t/message-expectation-that-verifies-result-of-passed-block/182463)

<div class="topic-metadata">

**Author:** [@phudson1442](https://www.ruby-forum.com/u/phudson1442)\
**Replies:** 6\
**Last updated:** [February 2, 2010, 4:02pm UTC](https://www.ruby-forum.com/t/message-expectation-that-verifies-result-of-passed-block/182463 "2010-02-02T16:02:06Z")

</div>

Hey speclers, My spec-fu is failing me on a message expectation in which I would like to verify that the block passed to a certain method yields the proper value. I would like to be able to say something like: def …

---

## [Specting controller post](https://www.ruby-forum.com/t/specting-controller-post/182756)

<div class="topic-metadata">

**Author:** [@Stephen\_S.stone](https://www.ruby-forum.com/u/Stephen_S.stone)\
**Replies:** 8\
**Last updated:** [February 2, 2010, 3:33pm UTC](https://www.ruby-forum.com/t/specting-controller-post/182756 "2010-02-02T15:33:13Z")

</div>

rspec-users mailing list removed\_email\_address@domain.invalid http://rubyforge.org/mailman/listinfo/rspec-users

---

## [Specing controller post](https://www.ruby-forum.com/t/specing-controller-post/182763)

<div class="topic-metadata">

**Author:** [@ssmithstone](https://www.ruby-forum.com/u/ssmithstone)\
**Replies:** 0\
**Last updated:** [February 2, 2010, 2:28pm UTC](https://www.ruby-forum.com/t/specing-controller-post/182763 "2010-02-02T14:28:15Z")

</div>

A bit stuck here being new to ruby and rspec Im trying to spec out a rails controller and using machinist to generate a model so in my spec i have it “should create new client” do // creates me a hash of generated v…

---

## [Somewhat confused by the help instructions](https://www.ruby-forum.com/t/somewhat-confused-by-the-help-instructions/182481)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 14\
**Last updated:** [February 1, 2010, 8:40pm UTC](https://www.ruby-forum.com/t/somewhat-confused-by-the-help-instructions/182481 "2010-02-01T20:40:15Z")

</div>

As a note of feedback, when I do a spec --help, I saw this line… -e, --example \[NAME|FILE\_NAME\] Execute example(s) with matching name(s). If the argument is the path to an existing file (typically generated by a pr…

---

## [Testing controllers using cucumber](https://www.ruby-forum.com/t/testing-controllers-using-cucumber/182532)

<div class="topic-metadata">

**Author:** [@tornado](https://www.ruby-forum.com/u/tornado)\
**Replies:** 3\
**Last updated:** [February 1, 2010, 6:50pm UTC](https://www.ruby-forum.com/t/testing-controllers-using-cucumber/182532 "2010-02-01T18:50:09Z")

</div>

Hello, Is there any way to test controllers using cucumber. I was doing it with rspec but since cucumber’s description is good how can i proceed testing it with cucumber? For e.g. I have a scenario of user creation …

---

## [Why we use RSpec](https://www.ruby-forum.com/t/why-we-use-rspec/182593)

<div class="topic-metadata">

**Author:** [@ravi\_singh](https://www.ruby-forum.com/u/ravi_singh)\
**Replies:** 4\
**Last updated:** [January 31, 2010, 6:50pm UTC](https://www.ruby-forum.com/t/why-we-use-rspec/182593 "2010-01-31T18:50:15Z")

</div>

Hi all, I am new to the RSpec, I have many questions related to the RSpec. Why one should use RSpec instead of other testing technique Which are the best tools than RSpec Where can i get RSpec demo

---

## [Can I set an expectation that a method invokes super?](https://www.ruby-forum.com/t/can-i-set-an-expectation-that-a-method-invokes-super/182479)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 2\
**Last updated:** [January 30, 2010, 10:57am UTC](https://www.ruby-forum.com/t/can-i-set-an-expectation-that-a-method-invokes-super/182479 "2010-01-30T10:57:13Z")

</div>

Not sure if I can easily do this Just ran into a bug in a rails app where ApplicationController overrides rescue\_action\_in\_public leading to the error page not being displayed. The fix was to call super at the end of…

---

## [Testing file attachment with Paperclip](https://www.ruby-forum.com/t/testing-file-attachment-with-paperclip/139949)

<div class="topic-metadata">

**Author:** [@Nicholas\_W](https://www.ruby-forum.com/u/Nicholas_W)\
**Replies:** 10\
**Last updated:** [January 29, 2010, 5:49am UTC](https://www.ruby-forum.com/t/testing-file-attachment-with-paperclip/139949 "2010-01-29T05:49:56Z")

</div>

Does someone have an example on faking a file upload for just ensuring it gets called, without actually uploading the file to s3. I thought that stubbing Model.has\_attached\_file would be enough, but it doesn’t seem so…

---

## [Typo on web-page](https://www.ruby-forum.com/t/typo-on-web-page/182383)

<div class="topic-metadata">

**Author:** [@Firat\_Can\_Basarir](https://www.ruby-forum.com/u/Firat_Can_Basarir)\
**Replies:** 0\
**Last updated:** [January 27, 2010, 10:59am UTC](https://www.ruby-forum.com/t/typo-on-web-page/182383 "2010-01-27T10:59:17Z")

</div>

There is a typo on the documentation page: http://rspec.info/rails/writing/controllers.html “Spec::Raiks” on the 2nd line of 2nd paragraph. I don’t know whom to contact about this. I hope the website maintainer is sub…

---

## [Unable to describe...expected?](https://www.ruby-forum.com/t/unable-to-describe-expected/182374)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 1\
**Last updated:** [January 27, 2010, 6:41am UTC](https://www.ruby-forum.com/t/unable-to-describe-expected/182374 "2010-01-27T06:41:12Z")

</div>

Question. I noticed that this code: class Redcar::Project describe FileMirror do is allowed, however this code module Redcar describe Project do … is not. Is this expected? -r

---

## [Troubles with route\_for](https://www.ruby-forum.com/t/troubles-with-route-for/181374)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 13\
**Last updated:** [January 24, 2010, 4:24am UTC](https://www.ruby-forum.com/t/troubles-with-route-for/181374 "2010-01-24T04:24:51Z")

</div>

Hey guys. I’m having some trouble with a route spec. In routes.rb , I have: map.connect ‘foods/search/:name’, :controller =\> :foods, :action =\> :search foods\_controller\_spec.rb has: Plain Text code by nickh - 5 lines…

---

## [Basic cucumber setup / usage question (OSX)](https://www.ruby-forum.com/t/basic-cucumber-setup-usage-question-osx/182128)

<div class="topic-metadata">

**Author:** [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Replies:** 1\
**Last updated:** [January 23, 2010, 12:10am UTC](https://www.ruby-forum.com/t/basic-cucumber-setup-usage-question-osx/182128 "2010-01-23T00:10:11Z")

</div>

I just installed cucumber and tried to run it on the included examples/self\_test. I get the error below: self\_test \> cucumber features/lots\_of\_undefined.feature no such file to load – spec/expectations (LoadError) /…

---

## [Double warning in doze](https://www.ruby-forum.com/t/double-warning-in-doze/182121)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 0\
**Last updated:** [January 22, 2010, 9:20pm UTC](https://www.ruby-forum.com/t/double-warning-in-doze/182121 "2010-01-22T21:20:27Z")

</div>

When I run autospec, I typically see this double warning–might be nice to clean it up a bit. You must ‘gem install win32console’ to use colour on Windows You must ‘gem install win32console’ to use colour on Windows

---

## [Call for a browser from command line in rakefile](https://www.ruby-forum.com/t/call-for-a-browser-from-command-line-in-rakefile/182088)

<div class="topic-metadata">

**Author:** [@ssri](https://www.ruby-forum.com/u/ssri)\
**Replies:** 0\
**Last updated:** [January 22, 2010, 12:23pm UTC](https://www.ruby-forum.com/t/call-for-a-browser-from-command-line-in-rakefile/182088 "2010-01-22T12:23:11Z")

</div>

I have a rakefile which run few tasks. I want to run my tests for different browsers using the rakefile. What would be the best suited way to achieve this? Please help.

---

## [Within method (and other Webrat methods)](https://www.ruby-forum.com/t/within-method-and-other-webrat-methods/182039)

<div class="topic-metadata">

**Author:** [@Onno\_van\_der\_Straat](https://www.ruby-forum.com/u/Onno_van_der_Straat)\
**Replies:** 1\
**Last updated:** [January 22, 2010, 6:13am UTC](https://www.ruby-forum.com/t/within-method-and-other-webrat-methods/182039 "2010-01-22T06:13:07Z")

</div>

Hi, Another newbie question. I’m sort of confused as I often find instructions on the internet that don’t work. Now I was looking for ways to click a link that can only be selected in a complex way using CSS select…

---

## [Error: stack level too deep](https://www.ruby-forum.com/t/error-stack-level-too-deep/182059)

<div class="topic-metadata">

**Author:** [@aaron\_zhang](https://www.ruby-forum.com/u/aaron_zhang)\
**Replies:** 1\
**Last updated:** [January 22, 2010, 5:54am UTC](https://www.ruby-forum.com/t/error-stack-level-too-deep/182059 "2010-01-22T05:54:23Z")

</div>

hi, guys i write follow code : it "The default should be based on readers to recommend a book tastes" do @pick\_book = mock\_model(PickBook) @pick\_books = \[@pick\_book\] @recommend\_count = 1 PickBook.should\_receiv…

---

## [Running specs on JRuby w/nailgun](https://www.ruby-forum.com/t/running-specs-on-jruby-w-nailgun/182037)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 1\
**Last updated:** [January 22, 2010, 12:04am UTC](https://www.ruby-forum.com/t/running-specs-on-jruby-w-nailgun/182037 "2010-01-22T00:04:57Z")

</div>

Hi all, I know this is probably more of a JRuby question but I’m guessing that people on this list may have gone down this path before. At work we are starting a new project using JRuby. The startup speed for testin…

---

## [\[rails\] undefined method \`handling\_predicate!'](https://www.ruby-forum.com/t/rails-undefined-method-handling-predicate/181980)

<div class="topic-metadata">

**Author:** [@drsharp](https://www.ruby-forum.com/u/drsharp)\
**Replies:** 2\
**Last updated:** [January 21, 2010, 11:52pm UTC](https://www.ruby-forum.com/t/rails-undefined-method-handling-predicate/181980 "2010-01-21T23:52:39Z")

</div>

I’m trying to use authlogic and factory\_girl with rspec and I am getting an error I don’t understand. Basically I have this failing spec: it “should succeed in creating a user from a factory” do testuser = Factory.…

---

## [Need Help with Specs failing when using ActionMailer](https://www.ruby-forum.com/t/need-help-with-specs-failing-when-using-actionmailer/180033)

<div class="topic-metadata">

**Author:** [@brad](https://www.ruby-forum.com/u/brad)\
**Replies:** 3\
**Last updated:** [January 21, 2010, 4:40am UTC](https://www.ruby-forum.com/t/need-help-with-specs-failing-when-using-actionmailer/180033 "2010-01-21T04:40:10Z")

</div>

No one was able to help me with the last post so I thought I would try again with more details. I am having problems with specs that invoke the mailer. My User model has a method that invokes a mailer as part of the…

---

## [Re: default to just call the method?](https://www.ruby-forum.com/t/re-default-to-just-call-the-method/181948)

<div class="topic-metadata">

**Author:** [@visage](https://www.ruby-forum.com/u/visage)\
**Replies:** 1\
**Last updated:** [January 20, 2010, 8:23pm UTC](https://www.ruby-forum.com/t/re-default-to-just-call-the-method/181948 "2010-01-20T20:23:13Z")

</div>

Is something like this what you were thinking of?

---

## [Display Rspec output in an html file](https://www.ruby-forum.com/t/display-rspec-output-in-an-html-file/178676)

<div class="topic-metadata">

**Author:** [@tornado](https://www.ruby-forum.com/u/tornado)\
**Replies:** 12\
**Last updated:** [January 20, 2010, 2:39pm UTC](https://www.ruby-forum.com/t/display-rspec-output-in-an-html-file/178676 "2010-01-20T14:39:13Z")

</div>

Hello, I had written some model scenarios. Now i want to generate that output in an html file. i am executing the models using rake i.e. rake spec:models from spec directory. But the html file is not getting generat…

---

## [Singleton classes](https://www.ruby-forum.com/t/singleton-classes/181865)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 3\
**Last updated:** [January 19, 2010, 4:15pm UTC](https://www.ruby-forum.com/t/singleton-classes/181865 "2010-01-19T16:15:49Z")

</div>

Hello I am trying to spec a singleton ruby class, And I am having a little trouble because my specs are not more isolated, as I am getting the same instace of the class for all my examples. How should I do this.? Wh…

---

## [RSpec for Rails 3](https://www.ruby-forum.com/t/rspec-for-rails-3/181869)

<div class="topic-metadata">

**Author:** [@tomx](https://www.ruby-forum.com/u/tomx)\
**Replies:** 3\
**Last updated:** [January 19, 2010, 2:39pm UTC](https://www.ruby-forum.com/t/rspec-for-rails-3/181869 "2010-01-19T14:39:48Z")

</div>

Hi folks, DHH has tentatively suggested a Rails 3 beta this month, so an innocent question: what’s the plan, such as it is, for Rails 3 support in RSpec? Personally there’s no way I’ll be able to move any of my applic…

---

## [Something like tags in cucumber](https://www.ruby-forum.com/t/something-like-tags-in-cucumber/181806)

<div class="topic-metadata">

**Author:** [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Replies:** 2\
**Last updated:** [January 18, 2010, 4:31pm UTC](https://www.ruby-forum.com/t/something-like-tags-in-cucumber/181806 "2010-01-18T16:31:37Z")

</div>

In cucumber, I use tags in a very simple, yet helpful (to me) way: to number my scenarios. For example: @1 Scenario: This is a scenario @2 Scenario: This is another scenario @3 Scenario: You get the idea This all…

---

## [Default to just call the method?](https://www.ruby-forum.com/t/default-to-just-call-the-method/181513)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 9\
**Last updated:** [January 18, 2010, 4:15pm UTC](https://www.ruby-forum.com/t/default-to-just-call-the-method/181513 "2010-01-18T16:15:13Z")

</div>

Any interest in the following idea? a.should include?(“1:4”) # if there’s no matcher called include? then just call include? or something along those lines? -r

---

## [Specify line for autorun?](https://www.ruby-forum.com/t/specify-line-for-autorun/181725)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 1\
**Last updated:** [January 17, 2010, 5:27pm UTC](https://www.ruby-forum.com/t/specify-line-for-autorun/181725 "2010-01-17T17:27:19Z")

</div>

Am I correct in assuming this should work (bug)? spec.fast\_require.rb contains the line require ‘spec/autorun’ E:\\dev\\ruby\\fast\_ruby\_require\\spec\>ruby spec.fast\_require.rb -l25 Only one file can be specified when provi…

---

## [Specs fail in rake spec but not command R](https://www.ruby-forum.com/t/specs-fail-in-rake-spec-but-not-command-r/181707)

<div class="topic-metadata">

**Author:** [@jko170](https://www.ruby-forum.com/u/jko170)\
**Replies:** 2\
**Last updated:** [January 16, 2010, 7:36pm UTC](https://www.ruby-forum.com/t/specs-fail-in-rake-spec-but-not-command-r/181707 "2010-01-16T19:36:32Z")

</div>

Surely I cannot be the only one experiencing this issue. I have some code that is “time/date sensitive”. Why do some specs fail when I run rake spec, but they do not when I use command R?

---

## [Autospec: non-standard filenames & redirecting output](https://www.ruby-forum.com/t/autospec-non-standard-filenames-redirecting-output/181643)

<div class="topic-metadata">

**Author:** [@DeNigris\_S](https://www.ruby-forum.com/u/DeNigris_S)\
**Replies:** 2\
**Last updated:** [January 16, 2010, 5:52pm UTC](https://www.ruby-forum.com/t/autospec-non-standard-filenames-redirecting-output/181643 "2010-01-16T17:52:21Z")

</div>

Rspec gurus, I have 2 questions about autospec. I’ve played around quite a bit, but can’t figure it out… I got autospec to work with my directory structure (“examples/\*\_example.rb”), but it only works if I have an …

---

## [Cucumber generator](https://www.ruby-forum.com/t/cucumber-generator/181526)

<div class="topic-metadata">

**Author:** [@Onno\_van\_der\_Straat](https://www.ruby-forum.com/u/Onno_van_der_Straat)\
**Replies:** 3\
**Last updated:** [January 16, 2010, 1:47pm UTC](https://www.ruby-forum.com/t/cucumber-generator/181526 "2010-01-16T13:47:46Z")

</div>

Hi, I’m new to RSpec and Cucumber and I’m following the RSpec book. I have cucumber gem installed but when I use script/generate cucumber it responds with Couldn’t find ‘cucumber’ generator? Thanks, Onno

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

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