# RSpec

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

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

---

## [Rspec - Creation of stories](https://www.ruby-forum.com/t/rspec-creation-of-stories/179768)

<div class="topic-metadata">

**Author:** [@daniel304](https://www.ruby-forum.com/u/daniel304)\
**Replies:** 1\
**Last updated:** [December 3, 2009, 2:07pm UTC](https://www.ruby-forum.com/t/rspec-creation-of-stories/179768 "2009-12-03T14:07:39Z")

</div>

Hi, I’m new to RSpec and installed the version 1.2.9. I was trying to write some of the stories’ examples on the web, but I was not able to let one run. The RDoc contains many examples, but should we write them in a…

---

## [Color output in pagers](https://www.ruby-forum.com/t/color-output-in-pagers/179717)

<div class="topic-metadata">

**Author:** [@polunochnik](https://www.ruby-forum.com/u/polunochnik)\
**Replies:** 4\
**Last updated:** [December 2, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/color-output-in-pagers/179717 "2009-12-02T21:46:10Z")

</div>

Hi. Is it possible to get color text in less, more or other pagers while piping the color output of Cucumber and RSpec? If it’s not possible is there any other methods to work with the color text in a console without …

---

## [Should\_receive(:x).at\_most/exactly... ignored when method is previously stubbed?](https://www.ruby-forum.com/t/should-receive-x-at-most-exactly-ignored-when-method-is-previously-stubbed/179677)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 4\
**Last updated:** [December 1, 2009, 8:51pm UTC](https://www.ruby-forum.com/t/should-receive-x-at-most-exactly-ignored-when-method-is-previously-stubbed/179677 "2009-12-01T20:51:25Z")

</div>

I’ve always used the idiom of stub collaborations in a before block and then focus in specific examples with should\_receive. (e.g. should\_receive takes presence over stub). I was just attempting to write an example fo…

---

## [Problem with ActionMailer in controller specs - works in model specs](https://www.ruby-forum.com/t/problem-with-actionmailer-in-controller-specs-works-in-model-specs/179621)

<div class="topic-metadata">

**Author:** [@brad](https://www.ruby-forum.com/u/brad)\
**Replies:** 0\
**Last updated:** [November 30, 2009, 6:49pm UTC](https://www.ruby-forum.com/t/problem-with-actionmailer-in-controller-specs-works-in-model-specs/179621 "2009-11-30T18:49:49Z")

</div>

I am having a problem with my controller tests that include ActionMailer. The tests work for the model test, e.g. I have a UserNotifier model that sends account activation e-mails and the spec’s work fine. When I ru…

---

## [Spec helper configuration problem](https://www.ruby-forum.com/t/spec-helper-configuration-problem/179539)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 2\
**Last updated:** [November 30, 2009, 12:15pm UTC](https://www.ruby-forum.com/t/spec-helper-configuration-problem/179539 "2009-11-30T12:15:51Z")

</div>

Hi all, I have a rails application whose specs run on about eight different boxes, but I can’t get them to work on my integration server. The bit thats breaking concerns some modules that I have in spec/support/modul…

---

## [Spork doesn't find helpers](https://www.ruby-forum.com/t/spork-doesnt-find-helpers/179550)

<div class="topic-metadata">

**Author:** [@html-kurs](https://www.ruby-forum.com/u/html-kurs)\
**Replies:** 2\
**Last updated:** [November 28, 2009, 12:18pm UTC](https://www.ruby-forum.com/t/spork-doesnt-find-helpers/179550 "2009-11-28T12:18:50Z")

</div>

Hi, I’m running into a problem with spork: The helper methods in app/helpers/simpler\_helper.rb are not found when using spork: rake spec (in longPath/test1) …F… ActionView::TemplateError in ‘/items/index.htm…

---

## [Depot app, Demeter's law and troubles cleanly specing](https://www.ruby-forum.com/t/depot-app-demeters-law-and-troubles-cleanly-specing/165874)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 24\
**Last updated:** [November 27, 2009, 12:16pm UTC](https://www.ruby-forum.com/t/depot-app-demeters-law-and-troubles-cleanly-specing/165874 "2009-11-27T12:16:12Z")

</div>

Hi, Let’s take the example of the depot app. In my controller I set @order. Then in the view comes the bad stuff: @order.items.each do |item| item.product.title end Now I’m having problems specing item.product.titl…

---

## [How to test a observer model?](https://www.ruby-forum.com/t/how-to-test-a-observer-model/179484)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 2\
**Last updated:** [November 27, 2009, 2:35am UTC](https://www.ruby-forum.com/t/how-to-test-a-observer-model/179484 "2009-11-27T02:35:07Z")

</div>

I have a user\_observer, code like this: def after\_create(user) UserMailer.deliver\_signup\_notification(user) user.random\_key = random\_key\_method user.save end before do @user = mock\_model(User) @user\_observer = Us…

---

## [Stubbing helper methods in controller specs when integrate\_views is On](https://www.ruby-forum.com/t/stubbing-helper-methods-in-controller-specs-when-integrate-views-is-on/179465)

<div class="topic-metadata">

**Author:** [@Krasimir\_Angelov](https://www.ruby-forum.com/u/Krasimir_Angelov)\
**Replies:** 1\
**Last updated:** [November 26, 2009, 7:28pm UTC](https://www.ruby-forum.com/t/stubbing-helper-methods-in-controller-specs-when-integrate-views-is-on/179465 "2009-11-26T19:28:58Z")

</div>

Hi all, I’m using rspec-caching-test-plugin to test caching (obviously) in my controller specs. Because views are also involved in caching integrate\_views have to be turned On. The problem comes when mock is passed …

---

## [Un-recognised routes that do exist, using namespaces & subdomain 	checking](https://www.ruby-forum.com/t/un-recognised-routes-that-do-exist-using-namespaces-subdomain-checking/178760)

<div class="topic-metadata">

**Author:** [@DEfusion](https://www.ruby-forum.com/u/DEfusion)\
**Replies:** 9\
**Last updated:** [November 26, 2009, 3:41am UTC](https://www.ruby-forum.com/t/un-recognised-routes-that-do-exist-using-namespaces-subdomain-checking/178760 "2009-11-26T03:41:26Z")

</div>

I’m getting really cheesed off with RSpec not matching some of my routes when controller testing when I have subdomain checking (courtesy of subdomain-fu) on namespaces. These routes appear in the rake routes output, …

---

## [Introductory recommendations?](https://www.ruby-forum.com/t/introductory-recommendations/179275)

<div class="topic-metadata">

**Author:** [@jonphillips](https://www.ruby-forum.com/u/jonphillips)\
**Replies:** 8\
**Last updated:** [November 25, 2009, 7:40pm UTC](https://www.ruby-forum.com/t/introductory-recommendations/179275 "2009-11-25T19:40:56Z")

</div>

Hi all, I’m with a team of engineers who are new to RSpec, and I’m looking for some good introductory material. Ideally it would be something like the two-part Railscast on Cucumber ( http://asciicasts.com/episodes/…

---

## [Cucumber Cygwin](https://www.ruby-forum.com/t/cucumber-cygwin/179373)

<div class="topic-metadata">

**Author:** [@mith](https://www.ruby-forum.com/u/mith)\
**Replies:** 5\
**Last updated:** [November 24, 2009, 4:13pm UTC](https://www.ruby-forum.com/t/cucumber-cygwin/179373 "2009-11-24T16:13:22Z")

</div>

Stuck as to what dependency is calling for cucumber 0.4.4 - we want to stick to 0.4.3 but Cygwin installation not allowing it - OK on Mac /usr/bin/ruby.exe -I “/usr/lib/ruby/gems/1.8/gems/cucumber-0.4.3/lib:lib” “/us…

---

## [Error executing specs using Ruby 1.9.1p243 and RSpec 1.2.9](https://www.ruby-forum.com/t/error-executing-specs-using-ruby-1-9-1p243-and-rspec-1-2-9/178461)

<div class="topic-metadata">

**Author:** [@conz](https://www.ruby-forum.com/u/conz)\
**Replies:** 8\
**Last updated:** [November 24, 2009, 5:43am UTC](https://www.ruby-forum.com/t/error-executing-specs-using-ruby-1-9-1p243-and-rspec-1-2-9/178461 "2009-11-24T05:43:03Z")

</div>

Hi, ‘rake spec’ failed to run on Ruby 1.9.1p243 and RSpec 1.2.9. I’m getting the following error message when I run the specs: /opt/local/lib/ruby/gems/1.9.1/gems/rspec-1.2.9/spec/spec/runner/ option\_parser\_spec.rb:2…

---

## [Rspec + autotest + rails engines](https://www.ruby-forum.com/t/rspec-autotest-rails-engines/179383)

<div class="topic-metadata">

**Author:** [@rafaelmazza](https://www.ruby-forum.com/u/rafaelmazza)\
**Replies:** 0\
**Last updated:** [November 23, 2009, 11:10pm UTC](https://www.ruby-forum.com/t/rspec-autotest-rails-engines/179383 "2009-11-23T23:10:54Z")

</div>

Hi everyone, I’m developing a rails app with several engines. I was wondering if it’s possible to autospec all my engine’s specs. I’ve tried putting the following content into my .autotest (in the app’s root directory…

---

## [Spec\_helper getting reloaded after specs run under Textmate/Spork](https://www.ruby-forum.com/t/spec-helper-getting-reloaded-after-specs-run-under-textmate-spork/179288)

<div class="topic-metadata">

**Author:** [@mcmire](https://www.ruby-forum.com/u/mcmire)\
**Replies:** 4\
**Last updated:** [November 23, 2009, 7:45pm UTC](https://www.ruby-forum.com/t/spec-helper-getting-reloaded-after-specs-run-under-textmate-spork/179288 "2009-11-23T19:45:27Z")

</div>

I’m having the hardest time trying to figure out something weird I’ve suddenly run into. So I’m using Spork to run my specs. Naturally I’ve got TM\_RSPEC\_OPTS in Textmate set to --drb and I’m running spork from the com…

---

## [\[rails\] strange regex validation failure](https://www.ruby-forum.com/t/rails-strange-regex-validation-failure/179306)

<div class="topic-metadata">

**Author:** [@ddancer](https://www.ruby-forum.com/u/ddancer)\
**Replies:** 2\
**Last updated:** [November 21, 2009, 7:10pm UTC](https://www.ruby-forum.com/t/rails-strange-regex-validation-failure/179306 "2009-11-21T19:10:23Z")

</div>

Hi, I’m getting invalid results when testing a Regex in a format validation on a Rails model. Code is… in Model allow ‘- n/a -’ or alphanum with \_ – no spaces validates\_format\_of :test\_name, :with =\> /\\A\[A-Za-z0-9\_\]+…

---

## [Gemspec development dependencies seems to be messed up](https://www.ruby-forum.com/t/gemspec-development-dependencies-seems-to-be-messed-up/179205)

<div class="topic-metadata">

**Author:** [@grimen](https://www.ruby-forum.com/u/grimen)\
**Replies:** 4\
**Last updated:** [November 21, 2009, 5:44pm UTC](https://www.ruby-forum.com/t/gemspec-development-dependencies-seems-to-be-messed-up/179205 "2009-11-21T17:44:20Z")

</div>

$ sudo gem install rspec-rails --development Password: ERROR: Error installing rspec-rails: rspec requires cucumber (\>= 0.3, development) …and when installed cucumber manually, it ends up with weird stuff. Is this …

---

## [Autospec not detecting new files](https://www.ruby-forum.com/t/autospec-not-detecting-new-files/179236)

<div class="topic-metadata">

**Author:** [@ddancer](https://www.ruby-forum.com/u/ddancer)\
**Replies:** 6\
**Last updated:** [November 20, 2009, 7:55pm UTC](https://www.ruby-forum.com/t/autospec-not-detecting-new-files/179236 "2009-11-20T19:55:12Z")

</div>

Hi, I have a project where autospec is not adding new files to it’s test list. When I run ‘rake spec’ it finds and runs the spec files. Wondering if there is a cache file that autospec is using? I’ve searched for an…

---

## [Running simple rspec, no output](https://www.ruby-forum.com/t/running-simple-rspec-no-output/179206)

<div class="topic-metadata">

**Author:** [@roxanne](https://www.ruby-forum.com/u/roxanne)\
**Replies:** 3\
**Last updated:** [November 20, 2009, 11:27am UTC](https://www.ruby-forum.com/t/running-simple-rspec-no-output/179206 "2009-11-20T11:27:12Z")

</div>

Hi, I am very new to Ruby and Rspec, and found a simple tutorial online about rspec. It involves two files: bowling.rb and bowling\_spec.rb bowling\_spec.rb require’rubygems’ require ‘spec’ require ‘bowling’ desc…

---

## [Rspec-rails gem double quoting (My)SQL?](https://www.ruby-forum.com/t/rspec-rails-gem-double-quoting-my-sql/179115)

<div class="topic-metadata">

**Author:** [@vanight](https://www.ruby-forum.com/u/vanight)\
**Replies:** 8\
**Last updated:** [November 19, 2009, 9:27pm UTC](https://www.ruby-forum.com/t/rspec-rails-gem-double-quoting-my-sql/179115 "2009-11-19T21:27:00Z")

</div>

Hi all, This seems like a plugin conflict (I haven’t yet had success replicating this in a new project), but short version is: when I have “rspec-rails” in my environment.rb plugin config, table names are double quote…

---

## [Cucumber and IP PBX testing](https://www.ruby-forum.com/t/cucumber-and-ip-pbx-testing/179174)

<div class="topic-metadata">

**Author:** [@robertico](https://www.ruby-forum.com/u/robertico)\
**Replies:** 2\
**Last updated:** [November 19, 2009, 6:32pm UTC](https://www.ruby-forum.com/t/cucumber-and-ip-pbx-testing/179174 "2009-11-19T18:32:53Z")

</div>

Hi, I am new to Cucumber. I am a test engineer for an IP PBX. Has anyone tried to use Cucumber to test such application? Some of the actions that I need to perform are: Given: a) Configure parameters on a web sit…

---

## [MockExpectationError actual args format for stubbed messages](https://www.ruby-forum.com/t/mockexpectationerror-actual-args-format-for-stubbed-messages/179141)

<div class="topic-metadata">

**Author:** [@tomx](https://www.ruby-forum.com/u/tomx)\
**Replies:** 1\
**Last updated:** [November 18, 2009, 8:59pm UTC](https://www.ruby-forum.com/t/mockexpectationerror-actual-args-format-for-stubbed-messages/179141 "2009-11-18T20:59:56Z")

</div>

Hi, Is it realistic and desirable to tweak RSpec so that the MockExpectationError for a stubbed message works as specified in the attached spec patch? In short, we wasted some time today on a wild goose chase because…

---

## [Undefined method \`register' for Polyglot:Module](https://www.ruby-forum.com/t/undefined-method-register-for-polyglot-module/179166)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 1\
**Last updated:** [November 18, 2009, 8:22pm UTC](https://www.ruby-forum.com/t/undefined-method-register-for-polyglot-module/179166 "2009-11-18T20:22:28Z")

</div>

Getting this error. I have the treetop, polyglot, and rspec libraries in the load\_path (not installed as a gem). Any ideas? What defines the register method? /home/jvandyk/dev/web/wpn\_rails/…/…/rcommon/lib/test/tre…

---

## [Rails /lib module testing](https://www.ruby-forum.com/t/rails-lib-module-testing/179060)

<div class="topic-metadata">

**Author:** [@ddancer](https://www.ruby-forum.com/u/ddancer)\
**Replies:** 1\
**Last updated:** [November 17, 2009, 2:42am UTC](https://www.ruby-forum.com/t/rails-lib-module-testing/179060 "2009-11-17T02:42:39Z")

</div>

I’ve seen several posts related, but not touching on what I’m wondering… I have a lib module that I’d like to do ‘white-box’ testing - similar to a Rails mvc. But I can’t see how to get a handle on the internal inst…

---

## [Stub a call that happens inside a block](https://www.ruby-forum.com/t/stub-a-call-that-happens-inside-a-block/179029)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 3\
**Last updated:** [November 16, 2009, 6:46am UTC](https://www.ruby-forum.com/t/stub-a-call-that-happens-inside-a-block/179029 "2009-11-16T06:46:22Z")

</div>

Hello list, I had a hard time to find out a way to mock the singleton feed method of the following class: class RssReader def self.feed(feed\_url) output = \[\] open(feed\_url) do |http| response = http.read result …

---

## [Using Mock / Datamapper / Associations](https://www.ruby-forum.com/t/using-mock-datamapper-associations/178951)

<div class="topic-metadata">

**Author:** [@arco](https://www.ruby-forum.com/u/arco)\
**Replies:** 2\
**Last updated:** [November 14, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/using-mock-datamapper-associations/178951 "2009-11-14T14:56:57Z")

</div>

I’m using datamapper and have two associated classes: Org - has n, :users User - belongs\_to :org When I test the User object, I have been able to mock/stub methods of the Org object. Great! But - I still need to re…

---

## [Ruby file.spec?](https://www.ruby-forum.com/t/ruby-file-spec/178888)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 5\
**Last updated:** [November 13, 2009, 8:16pm UTC](https://www.ruby-forum.com/t/ruby-file-spec/178888 "2009-11-13T20:16:07Z")

</div>

perhaps this has been discussed before and you can point me to the right thread, but is it possible to run specs from the command line using just ruby? ruby arguments\_spec.rb and it “just run” (like test/unit seems t…

---

## [Better documentation?](https://www.ruby-forum.com/t/better-documentation/178457)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 3\
**Last updated:** [November 13, 2009, 4:20am UTC](https://www.ruby-forum.com/t/better-documentation/178457 "2009-11-13T04:20:11Z")

</div>

I’m interested in helping the documentation for rspec, ex: described similarly to how this person feels (that there’s not too much “getting started” docu). http://creativedeletion.com/2007/05/27/the-new-rspec-format…

---

## [Odd error](https://www.ruby-forum.com/t/odd-error/178451)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 2\
**Last updated:** [November 13, 2009, 1:46am UTC](https://www.ruby-forum.com/t/odd-error/178451 "2009-11-13T01:46:49Z")

</div>

with 1.8.6 + rspec 1.2.9 (sorry couldn’t try trunk, see previous post) I get: C:\\dev\\ruby\\old\\arguments\>spec spec\\arguments\_spec.rb …F… 0.000000 0.000000 0.000000 ( 0.000000) .F 0.000000 0.000000 0.000000 …

---

## [Returning a StringIO object from a stub](https://www.ruby-forum.com/t/returning-a-stringio-object-from-a-stub/178835)

<div class="topic-metadata">

**Author:** [@JGailor](https://www.ruby-forum.com/u/JGailor)\
**Replies:** 2\
**Last updated:** [November 12, 2009, 7:12pm UTC](https://www.ruby-forum.com/t/returning-a-stringio-object-from-a-stub/178835 "2009-11-12T19:12:50Z")

</div>

I’m trying to stub File.new so I can return a StringIO object from it to set some expectation and make sure the subject under test is behaving correctly, but calling readline() on the StringIO object in the subject al…

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

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