# RSpec

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

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

---

## [Check out my shelves](https://www.ruby-forum.com/t/check-out-my-shelves/192095)

<div class="topic-metadata">

**Author:** [@Varchar](https://www.ruby-forum.com/u/Varchar)\
**Replies:** 1\
**Last updated:** [July 23, 2010, 6:30pm UTC](https://www.ruby-forum.com/t/check-out-my-shelves/192095 "2010-07-23T18:30:45Z")

</div>

Hi rspec, Check out the books I added on Goodreads. users&e=removed\_email\_address@domain.invalid&i=LTM2MDMwNTExMjM6MzY1 Varchar (removed\_email\_address@domain.invalid) Goodreads is a community for book lovers. It’…

---

## [Parameterised shared examples / metadata in examples (RSpec 2)](https://www.ruby-forum.com/t/parameterised-shared-examples-metadata-in-examples-rspec-2/192068)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [July 23, 2010, 10:39am UTC](https://www.ruby-forum.com/t/parameterised-shared-examples-metadata-in-examples-rspec-2/192068 "2010-07-23T10:39:26Z")

</div>

Hi Warning: this goes on quite a bit. It contains early-morning caffeinated ramblings and many “hmmm I wonder what this does…” snippets. I’m looking for the best way to parameterise shared examples. Imagine (as an…

---

## [Should\_receive test unexpectedly failing](https://www.ruby-forum.com/t/should-receive-test-unexpectedly-failing/192036)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 1\
**Last updated:** [July 22, 2010, 6:32pm UTC](https://www.ruby-forum.com/t/should-receive-test-unexpectedly-failing/192036 "2010-07-22T18:32:58Z")

</div>

I’m unsure why this test is still failing. I’ve tested it in console and the code works as expected. Is there something wrong with how I have my test written? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* error Job selecting the next job to…

---

## ['its' not working](https://www.ruby-forum.com/t/its-not-working/191976)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 2\
**Last updated:** [July 22, 2010, 12:00pm UTC](https://www.ruby-forum.com/t/its-not-working/191976 "2010-07-22T12:00:38Z")

</div>

trying out new syntax from jon larkowski’s rspec presentation. Following doesn’t work in that when I run the line from the command prompt or from textmate no specs are run context “cancel” do subject do order = at\_d…

---

## [\[rails\] shoud I test validate\_presentence\_of series?](https://www.ruby-forum.com/t/rails-shoud-i-test-validate-presentence-of-series/191950)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 3\
**Last updated:** [July 22, 2010, 3:30am UTC](https://www.ruby-forum.com/t/rails-shoud-i-test-validate-presentence-of-series/191950 "2010-07-22T03:30:18Z")

</div>

Suppose I have a model Forum, have some attributes, title, content, tag.so I do it in Forum model. validates\_presence\_of :title validates\_presence\_of :tag validates\_presence\_of :content. when I added validateds\_pres…

---

## [Spec w/o db:test:prepare](https://www.ruby-forum.com/t/spec-w-o-dbprepare/191936)

<div class="topic-metadata">

**Author:** [@churp](https://www.ruby-forum.com/u/churp)\
**Replies:** 4\
**Last updated:** [July 22, 2010, 12:05am UTC](https://www.ruby-forum.com/t/spec-w-o-dbprepare/191936 "2010-07-22T00:05:14Z")

</div>

HI All, I would like to perform my spec runs without the db:test:prepare rake prereq. It would be nice if I could alter spec to prereq db:test:purge only. Could you give me some advice/urls/pointers on how best to go…

---

## [Methods not available](https://www.ruby-forum.com/t/methods-not-available/191924)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 2\
**Last updated:** [July 21, 2010, 3:18am UTC](https://www.ruby-forum.com/t/methods-not-available/191924 "2010-07-21T03:18:17Z")

</div>

Hi all. Noticed that with rspec 1.x methods at “higher levels” aren’t available in lower, ex: context “a” do def go end it “should pass” do go end it “should pass again” do context “a::b” do go end end end T…

---

## [Event machine support](https://www.ruby-forum.com/t/event-machine-support/191896)

<div class="topic-metadata">

**Author:** [@trung](https://www.ruby-forum.com/u/trung)\
**Replies:** 1\
**Last updated:** [July 21, 2010, 3:14am UTC](https://www.ruby-forum.com/t/event-machine-support/191896 "2010-07-21T03:14:11Z")

</div>

I have a question of how rspec treat eventmachined rails app. My understanding is eventmachined is normally run within Thin, and it is Thin who initiates the event loop. So how do you test the eventmachined rails app?…

---

## [Rspec2 help output has brackets?](https://www.ruby-forum.com/t/rspec2-help-output-has-brackets/191833)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 3\
**Last updated:** [July 21, 2010, 2:02am UTC](https://www.ruby-forum.com/t/rspec2-help-output-has-brackets/191833 "2010-07-21T02:02:11Z")

</div>

Hi all. Saw this: Usage: rspec \[options\] \[files or directories\] -b, --backtrace Enable full backtrace -c, --\[no-\]color, --\[no-\]colour Enable color in the output -d, --debug Ena…

---

## [\[Rspec-Rails\] before(:all) doesn't rollback](https://www.ruby-forum.com/t/rspec-rails-before-all-doesnt-rollback/191903)

<div class="topic-metadata">

**Author:** [@Bogdan\_Gusiev](https://www.ruby-forum.com/u/Bogdan_Gusiev)\
**Replies:** 1\
**Last updated:** [July 20, 2010, 3:25pm UTC](https://www.ruby-forum.com/t/rspec-rails-before-all-doesnt-rollback/191903 "2010-07-20T15:25:06Z")

</div>

I don’t if this is a bug or feature but if before(:all) create some persistent objects, these changes doesn’t rollback when we get out of the context. Here are simplest example to see the issue: describe Person do …

---

## [How do I setup Rspec, Cucumber to test a Gem?](https://www.ruby-forum.com/t/how-do-i-setup-rspec-cucumber-to-test-a-gem/191846)

<div class="topic-metadata">

**Author:** [@walt](https://www.ruby-forum.com/u/walt)\
**Replies:** 3\
**Last updated:** [July 20, 2010, 2:57pm UTC](https://www.ruby-forum.com/t/how-do-i-setup-rspec-cucumber-to-test-a-gem/191846 "2010-07-20T14:57:34Z")

</div>

Hi, my question unwields me as a complete noob - which is okay - but I apologize for this totally basic question \<:) I’ve bought the PragProg Rspec Book and googled, been reading blogs and what-have-I-not, but nowher…

---

## [Controller.should\_receive(:render) problem](https://www.ruby-forum.com/t/controller-should-receive-render-problem/191897)

<div class="topic-metadata">

**Author:** [@ruprict](https://www.ruby-forum.com/u/ruprict)\
**Replies:** 1\
**Last updated:** [July 20, 2010, 2:15pm UTC](https://www.ruby-forum.com/t/controller-should-receive-render-problem/191897 "2010-07-20T14:15:23Z")

</div>

Hi. My issue is similar to the one in this post: http://groups.google.com/group/rspec/browse\_thread/thread/973d770e45bdd6cd/8ba067476003f08f?lnk=gst&q=render+controller+should\_receive#8ba067476003f08f (which, btw, I c…

---

## ["bundle exec rspec" vs "rake spec"](https://www.ruby-forum.com/t/bundle-exec-rspec-vs-rake-spec/191894)

<div class="topic-metadata">

**Author:** [@jay](https://www.ruby-forum.com/u/jay)\
**Replies:** 1\
**Last updated:** [July 20, 2010, 1:39pm UTC](https://www.ruby-forum.com/t/bundle-exec-rspec-vs-rake-spec/191894 "2010-07-20T13:39:05Z")

</div>

I’m in the process of upgrading my rails app to rails 3 and I’m getting different results from running the 2 commands above. The “bundle exec rspec” runs my tests correctly, but when I run “rake spec” it doesn’t seem…

---

## [Deprecate mock\_model?](https://www.ruby-forum.com/t/deprecate-mock-model/191873)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 1\
**Last updated:** [July 20, 2010, 6:03am UTC](https://www.ruby-forum.com/t/deprecate-mock-model/191873 "2010-07-20T06:03:00Z")

</div>

Hey all, I’m thinking of deprecating mock\_model in rspec-rails-2. stub\_model is more stable, reliable (not dependent on Rails internals like mock\_model is), much less intrusive, and I find that I use it all the time i…

---

## [Data-wise context combination for controller speccing](https://www.ruby-forum.com/t/data-wise-context-combination-for-controller-speccing/191760)

<div class="topic-metadata">

**Author:** [@Costa\_Shapiro](https://www.ruby-forum.com/u/Costa_Shapiro)\
**Replies:** 8\
**Last updated:** [July 19, 2010, 4:34pm UTC](https://www.ruby-forum.com/t/data-wise-context-combination-for-controller-speccing/191760 "2010-07-19T16:34:30Z")

</div>

Hello, I’ve been thinking of how to express my idea in code, but since I’ve never been involved in RSpec development, I’d better have some feedback here first. The feature suggestion below applies to any controller-…

---

## [Gem conflict with RSpec::Rails and Sunspot](https://www.ruby-forum.com/t/gem-conflict-with-rspec-rails-and-sunspot/191802)

<div class="topic-metadata">

**Author:** [@codejoy](https://www.ruby-forum.com/u/codejoy)\
**Replies:** 6\
**Last updated:** [July 19, 2010, 4:12am UTC](https://www.ruby-forum.com/t/gem-conflict-with-rspec-rails-and-sunspot/191802 "2010-07-19T04:12:13Z")

</div>

Hi All I was wondering if someone could perhaps point me to where in RSpec::Rails is the Rails ActionController being subclassed by an Object instance? My ruby-fu is not high enough to work out what’s really going o…

---

## [Assigns and should eql don't work as expected](https://www.ruby-forum.com/t/assigns-and-should-eql-dont-work-as-expected/191741)

<div class="topic-metadata">

**Author:** [@dazuma](https://www.ruby-forum.com/u/dazuma)\
**Replies:** 4\
**Last updated:** [July 17, 2010, 11:57pm UTC](https://www.ruby-forum.com/t/assigns-and-should-eql-dont-work-as-expected/191741 "2010-07-17T23:57:12Z")

</div>

Today I’ve been writing some tests for a new rails 3 app, but after reading the doc from http://rdoc.info/projects/rspec/rspec-expectations, I still can’t understand why the test doesn’t work. My setup is: rvm 0.1.41 …

---

## [How are people speccing and cuke-ing Paperclip (with S3)?](https://www.ruby-forum.com/t/how-are-people-speccing-and-cuke-ing-paperclip-with-s3/191753)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 4\
**Last updated:** [July 17, 2010, 8:02pm UTC](https://www.ruby-forum.com/t/how-are-people-speccing-and-cuke-ing-paperclip-with-s3/191753 "2010-07-17T20:02:30Z")

</div>

Hi – I’m running into all sorts of difficulties trying to use paperclip with cucumber and rspec. Basically, I’m stubbing out paperclip calls with WebMock (I’ve adapted the shoulda macro that uses FakeWeb to do this). …

---

## [How are people speccing Rails 3 ActiveRecord queries?](https://www.ruby-forum.com/t/how-are-people-speccing-rails-3-activerecord-queries/191754)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 4\
**Last updated:** [July 17, 2010, 7:43pm UTC](https://www.ruby-forum.com/t/how-are-people-speccing-rails-3-activerecord-queries/191754 "2010-07-17T19:43:11Z")

</div>

Hi – how are people speccing Rails 3 ActiveRecord queries? At the minute I’m chaining a load of should\_receive calls on mock relation objects, but can’t help thinking that there must be a more elegant way of going a…

---

## [Re: Questions about testing a module method that randomly creates stuff from list](https://www.ruby-forum.com/t/re-questions-about-testing-a-module-method-that-randomly-creates-stuff-from-list/191722)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 1\
**Last updated:** [July 17, 2010, 2:34am UTC](https://www.ruby-forum.com/t/re-questions-about-testing-a-module-method-that-randomly-creates-stuff-from-list/191722 "2010-07-17T02:34:49Z")

</div>

\---- David C. removed\_email\_address@domain.invalid wrote: On Jul 15, 2010, at 12:18 PM, Greg D. wrote: This sounds like a long, procedural method. Can it be broken down any further (i.e. delegating more of its work to…

---

## [Shared example groups](https://www.ruby-forum.com/t/shared-example-groups/191717)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [July 16, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/shared-example-groups/191717 "2010-07-16T16:39:28Z")

</div>

Hey all, For anyone interested in shared example groups, please read and feel free to comment on Issues · rspec/rspec-core · GitHub. Cheers, David

---

## [Rspec route question](https://www.ruby-forum.com/t/rspec-route-question/191670)

<div class="topic-metadata">

**Author:** [@Matt\_Kolenda](https://www.ruby-forum.com/u/Matt_Kolenda)\
**Replies:** 1\
**Last updated:** [July 16, 2010, 1:37pm UTC](https://www.ruby-forum.com/t/rspec-route-question/191670 "2010-07-16T13:37:21Z")

</div>

Hello I’m having some trouble getting rspec to recognize a route. This works describe “routes” do it “should have a route” do { :get =\> “/accounts/3/jobs/3/ applications/1/edit” }.should route\_to(:controller =\> ‘app…

---

## [Questions about testing a module method that randomly creates stuff from list](https://www.ruby-forum.com/t/questions-about-testing-a-module-method-that-randomly-creates-stuff-from-list/191648)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 1\
**Last updated:** [July 16, 2010, 1:36pm UTC](https://www.ruby-forum.com/t/questions-about-testing-a-module-method-that-randomly-creates-stuff-from-list/191648 "2010-07-16T13:36:10Z")

</div>

All, I have a method in a shared Module that shuffles data and then output other data. The method is somewhat large (maybe 50 lines) and sometimes calls other sub methods to help to complete the output which must me…

---

## [Set expectation using self in constructor?](https://www.ruby-forum.com/t/set-expectation-using-self-in-constructor/191569)

<div class="topic-metadata">

**Author:** [@cremes](https://www.ruby-forum.com/u/cremes)\
**Replies:** 8\
**Last updated:** [July 16, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/set-expectation-using-self-in-constructor/191569 "2010-07-16T13:30:54Z")

</div>

I find myself using this pattern quite a bit. rspec 1.30 ruby 1.9.1, 1.9.2-rc2, jruby 1.51 all on osx 10.6.4 class Foo def initialize @bar = Bar.new end end context “init” do it “should allocate a helper class B…

---

## [Heckle & RSpec 2](https://www.ruby-forum.com/t/heckle-rspec-2/191669)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 1\
**Last updated:** [July 16, 2010, 2:18am UTC](https://www.ruby-forum.com/t/heckle-rspec-2/191669 "2010-07-16T02:18:16Z")

</div>

How do I run Heckle with RSpec? I’ve tried rake spec --heckle but get no output. I’ve tried just -heckle too, as mentioned in the docs, but that isn’t accepted as a valid option and the help out is displayed. I have…

---

## [Help needed for instslling rspec](https://www.ruby-forum.com/t/help-needed-for-instslling-rspec/191649)

<div class="topic-metadata">

**Author:** [@PatelS\_Mihir](https://www.ruby-forum.com/u/PatelS_Mihir)\
**Replies:** 1\
**Last updated:** [July 15, 2010, 8:21pm UTC](https://www.ruby-forum.com/t/help-needed-for-instslling-rspec/191649 "2010-07-15T20:21:08Z")

</div>

Hi All, I am new to BDD. I have ruby 1.8.7 on my RHEL5 computer. I am trying to install RSpec by “gem install rspec” but I get an error saying : “could not find rspec locally or in a repository”, Please help me out. …

---

## [Questions about testing a module method that randomly creates stuff from list](https://www.ruby-forum.com/t/questions-about-testing-a-module-method-that-randomly-creates-stuff-from-list/191646)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 0\
**Last updated:** [July 15, 2010, 7:29pm UTC](https://www.ruby-forum.com/t/questions-about-testing-a-module-method-that-randomly-creates-stuff-from-list/191646 "2010-07-15T19:29:00Z")

</div>

All, I have a method in a shared Module that shuffles data and then output other data. The method is somewhat large (maybe 50 lines) and sometimes calls other sub methods to help to complete the output which must …

---

## [Before(:all) to set up mocks and stubs](https://www.ruby-forum.com/t/before-all-to-set-up-mocks-and-stubs/191497)

<div class="topic-metadata">

**Author:** [@Ivo\_D](https://www.ruby-forum.com/u/Ivo_D)\
**Replies:** 3\
**Last updated:** [July 15, 2010, 10:08am UTC](https://www.ruby-forum.com/t/before-all-to-set-up-mocks-and-stubs/191497 "2010-07-15T10:08:07Z")

</div>

Hi I’m upgrading an application to rspec2/rails3. A certain suite of tests, that generates a pdf document, uses a before(:all) filter to set the environment using mocks and stubs. Then the pdf gets generated and after …

---

## [Pending blocks](https://www.ruby-forum.com/t/pending-blocks/191598)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 1\
**Last updated:** [July 15, 2010, 3:00am UTC](https://www.ruby-forum.com/t/pending-blocks/191598 "2010-07-15T03:00:53Z")

</div>

Would it be possible to have pending be accessible everywhere? Curgem rently with describe ‘’ do pending ‘abc’ do end end yields: C:\\dev\\ruby\\universal-scene-skipper\\spec\>spec small.spec C:/dev/ruby/universal-sce…

---

## [Windowed comparison for differences in the middle of long strings](https://www.ruby-forum.com/t/windowed-comparison-for-differences-in-the-middle-of-long-strings/191588)

<div class="topic-metadata">

**Author:** [@combas](https://www.ruby-forum.com/u/combas)\
**Replies:** 0\
**Last updated:** [July 14, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/windowed-comparison-for-differences-in-the-middle-of-long-strings/191588 "2010-07-14T21:17:51Z")

</div>

When two strings fail to match, if the difference is somewhere in the middle of the strings, it can be annoying/impossible to track down the actual difference. I’ve written a little Comparison object that provides thi…

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

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