# RSpec

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

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

---

## [Rspec --help gives undefined method 'Pathname'](https://www.ruby-forum.com/t/rspec-help-gives-undefined-method-pathname/197762)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [October 19, 2010, 11:40pm UTC](https://www.ruby-forum.com/t/rspec-help-gives-undefined-method-pathname/197762 "2010-10-19T23:40:09Z")

</div>

Trying to setup environment on xandros linux. running ruby 1.9 gem 1.3.7 sudo gem install rspec but when I issue rspechelp I receive the following /usr/lib/ruby/gems/1.9/gems/rspec-core-2.0.0/lib/rspec/core/ruby\_pr…

---

## [RSpec Routing DSL](https://www.ruby-forum.com/t/rspec-routing-dsl/197699)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 4\
**Last updated:** [October 19, 2010, 8:35pm UTC](https://www.ruby-forum.com/t/rspec-routing-dsl/197699 "2010-10-19T20:35:24Z")

</div>

I started testing routes for the first time in Rails 3 this weekend during Rails Rumble. I was so exhausted that I found writing route specs a very painful task. I came up with my own routing DSL and I’d love to see i…

---

## ["contain" not defined in view spec](https://www.ruby-forum.com/t/contain-not-defined-in-view-spec/226088)

<div class="topic-metadata">

**Author:** [@srveit](https://www.ruby-forum.com/u/srveit)\
**Replies:** 1\
**Last updated:** [October 19, 2010, 2:33am UTC](https://www.ruby-forum.com/t/contain-not-defined-in-view-spec/226088 "2010-10-19T02:33:14Z")

</div>

Using Rails 2 and rspec-rails 2.0.1. I have the following view spec: require ‘spec\_helper’ describe “bookmarkers/show.html.haml” do include BookmarkersHelper before(:each) do @bookmarker = mock\_model(Bookmarker) @…

---

## [Color not displaying when using an autowatchr script](https://www.ruby-forum.com/t/color-not-displaying-when-using-an-autowatchr-script/197570)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [October 18, 2010, 3:14pm UTC](https://www.ruby-forum.com/t/color-not-displaying-when-using-an-autowatchr-script/197570 "2010-10-18T15:14:21Z")

</div>

When running RSpec 2.0.0.beta22, I would get colour output in the console from my specs Now, with 2.0.0 no color is used. If I run the rspec command directly, color is displaying again. I have --color in my .rspec f…

---

## [RSpec tasks, JRuby and rvm](https://www.ruby-forum.com/t/rspec-tasks-jruby-and-rvm/188184)

<div class="topic-metadata">

**Author:** [@dracko](https://www.ruby-forum.com/u/dracko)\
**Replies:** 2\
**Last updated:** [October 15, 2010, 1:38pm UTC](https://www.ruby-forum.com/t/rspec-tasks-jruby-and-rvm/188184 "2010-10-15T13:38:32Z")

</div>

I’ve been playing with rvm these days and I had a bad surprise today. $ rvm install jruby $ rvm jruby $ rake test failed… Of course you didn’t understand. I didn’t explain yet… I’ve written a Rakefile following RSp…

---

## [Testing 'nil.should == something\_not\_nil' fails](https://www.ruby-forum.com/t/testing-nil-should-something-not-nil-fails/197387)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 1\
**Last updated:** [October 14, 2010, 3:12am UTC](https://www.ruby-forum.com/t/testing-nil-should-something-not-nil-fails/197387 "2010-10-14T03:12:12Z")

</div>

Hello, After upgrading to rspec 2.0.0.rc, I ran into an issue that I reported at Failure to render diff for 'nil.should == something\_not\_nil' · Issue #183 · rspec/rspec-core · GitHub. When testing something that retur…

---

## [No such file to load -- spec/rake/spectask](https://www.ruby-forum.com/t/no-such-file-to-load-spec-rake-spectask/197369)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 4\
**Last updated:** [October 13, 2010, 4:28pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-spec-rake-spectask/197369 "2010-10-13T16:28:34Z")

</div>

Hello there I’m running a rails 2.3.5 project and I can’t run any rake tasks My error is no such file to load – spec/rake/spectask Here’s a relevant snippet of gem list output rails (2.3.5) rake (0.8.7) random\_dat…

---

## [Strange return value](https://www.ruby-forum.com/t/strange-return-value/195862)

<div class="topic-metadata">

**Author:** [@Zhi-Qiang\_L](https://www.ruby-forum.com/u/Zhi-Qiang_L)\
**Replies:** 3\
**Last updated:** [October 13, 2010, 5:53am UTC](https://www.ruby-forum.com/t/strange-return-value/195862 "2010-10-13T05:53:08Z")

</div>

Dear All, I meet a strange issue when I test my Rack Middleware. Could anyone help me to point the error out? Thanks. This is the code. class EIOUAuthorization def initialize(app) @app = app end def call(env) re…

---

## [Rails 3 and rspec 2 turning off transactional fixtures per test](https://www.ruby-forum.com/t/rails-3-and-rspec-2-turning-off-transactional-fixtures-per-test/197341)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [October 13, 2010, 2:19am UTC](https://www.ruby-forum.com/t/rails-3-and-rspec-2-turning-off-transactional-fixtures-per-test/197341 "2010-10-13T02:19:27Z")

</div>

I am having trouble turning off transactional fixtures per test in Rails 3 with rspec 2. I did this successfully with rspec 1.3.1 and rails 2. rspec version is 2.0.0.rc Below is my stack overflow question which prov…

---

## [Testing methods that yields a block](https://www.ruby-forum.com/t/testing-methods-that-yields-a-block/196358)

<div class="topic-metadata">

**Author:** [@ignacy](https://www.ruby-forum.com/u/ignacy)\
**Replies:** 3\
**Last updated:** [October 12, 2010, 11:02pm UTC](https://www.ruby-forum.com/t/testing-methods-that-yields-a-block/196358 "2010-10-12T23:02:46Z")

</div>

I want to test a class method that sets some state and then yields a block. It looks something like that: class Cat class \<\< self def start id = get\_uuid begin yield if block\_given? ensure set\_some\_other\_state …

---

## [DateTime.now.utc in fixtures](https://www.ruby-forum.com/t/datetime-now-utc-in-fixtures/196356)

<div class="topic-metadata">

**Author:** [@Russell\_Quinn](https://www.ruby-forum.com/u/Russell_Quinn)\
**Replies:** 4\
**Last updated:** [October 12, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/datetime-now-utc-in-fixtures/196356 "2010-10-12T15:03:13Z")

</div>

I have the following in my fixtures: publish\_date: \<%= DateTime.now.utc - 1.day %\> But ‘DateTime.now.utc’ always evaluates to my system time. Does anyone have any ideas? Thanks, Russell.

---

## [RSpec-2.0.0 is released!](https://www.ruby-forum.com/t/rspec-2-0-0-is-released/196292)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 8\
**Last updated:** [October 12, 2010, 2:45pm UTC](https://www.ruby-forum.com/t/rspec-2-0-0-is-released/196292 "2010-10-12T14:45:35Z")

</div>

RSpec-2.0.0 has been released! This marks the end of a year-long effort that improves RSpec in a number of ways, including modularity, cleaner code, and much better integration with Rails-3 than was possible before (s…

---

## [Render\_template giving an odd error?](https://www.ruby-forum.com/t/render-template-giving-an-odd-error/196357)

<div class="topic-metadata">

**Author:** [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Replies:** 1\
**Last updated:** [October 12, 2010, 8:50am UTC](https://www.ruby-forum.com/t/render-template-giving-an-odd-error/196357 "2010-10-12T08:50:52Z")

</div>

Hey all, I’m trying to migrate over to Rails3/RSpec2 and I cannot seem to get the specing of render right. I know there was some changes in RSpec2 that affect this, and I was hoping to get a bit of help. I have this i…

---

## [How to test named\_scope](https://www.ruby-forum.com/t/how-to-test-named-scope/196359)

<div class="topic-metadata">

**Author:** [@cyrus](https://www.ruby-forum.com/u/cyrus)\
**Replies:** 1\
**Last updated:** [October 12, 2010, 8:37am UTC](https://www.ruby-forum.com/t/how-to-test-named-scope/196359 "2010-10-12T08:37:43Z")

</div>

how a can test this controller using rspec #home controller def home @recents = Article.publisheds.with\_authorship.paginate(:page =\> 1, :per\_page =\> 10, :total\_entries =\> 10) @highlight = Article.publisheds.highligh…

---

## [I am trying to subscribe to this group, and Google is saying:](https://www.ruby-forum.com/t/i-am-trying-to-subscribe-to-this-group-and-google-is-saying/196355)

<div class="topic-metadata">

**Author:** [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Replies:** 0\
**Last updated:** [October 12, 2010, 7:50am UTC](https://www.ruby-forum.com/t/i-am-trying-to-subscribe-to-this-group-and-google-is-saying/196355 "2010-10-12T07:50:02Z")

</div>

There is a problem with your choice of subscription type No other comment? WTF? W$7 install on Xeno’s RI Laptop.

---

## [I am trying to find out a way to use the Selenium facility to get cross browser support in some simp](https://www.ruby-forum.com/t/i-am-trying-to-find-out-a-way-to-use-the-selenium-facility-to-get-cross-browser-support-in-some-simp/196354)

<div class="topic-metadata">

**Author:** [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Replies:** 0\
**Last updated:** [October 12, 2010, 7:50am UTC](https://www.ruby-forum.com/t/i-am-trying-to-find-out-a-way-to-use-the-selenium-facility-to-get-cross-browser-support-in-some-simp/196354 "2010-10-12T07:50:02Z")

</div>

I would be glad to see: Generation of usable Selenium Core Test Suites. Instructions to create a proxy server to run the tests, like with Selenium Grid or some such thing. Any other thing that allows m…

---

## [Rspec-1.3.1 and rspec-rails-1.3.3 are released!](https://www.ruby-forum.com/t/rspec-1-3-1-and-rspec-rails-1-3-3-are-released/196270)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [October 10, 2010, 4:52am UTC](https://www.ruby-forum.com/t/rspec-1-3-1-and-rspec-rails-1-3-3-are-released/196270 "2010-10-10T04:52:52Z")

</div>

I just released rspec-1.3.1 and rspec-rails-1.3.3. These are mostly bug fixes that have been sitting around for all to long as I focused on rspec-2 (coming very soon). Report issues for rspec\[-rails\]-1.x to Lighthous…

---

## [Rspec-1.3.1.rc and rspec-rails-1.3.3.rc are released!](https://www.ruby-forum.com/t/rspec-1-3-1-rc-and-rspec-rails-1-3-3-rc-are-released/195956)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 2\
**Last updated:** [October 10, 2010, 1:54am UTC](https://www.ruby-forum.com/t/rspec-1-3-1-rc-and-rspec-rails-1-3-3-rc-are-released/195956 "2010-10-10T01:54:45Z")

</div>

rspec-1.3.1.rc and rspec-rails-1.3.3.rc are released! These are release candidate gems for updates 1.x series, including some bug fixes and deprecation warnings for functionality that will be removed in rspec-2. Barr…

---

## [Could not find shared example group named "an admin is logged in"](https://www.ruby-forum.com/t/could-not-find-shared-example-group-named-an-admin-is-logged-in/196177)

<div class="topic-metadata">

**Author:** [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Replies:** 5\
**Last updated:** [October 8, 2010, 3:38pm UTC](https://www.ruby-forum.com/t/could-not-find-shared-example-group-named-an-admin-is-logged-in/196177 "2010-10-08T15:38:12Z")

</div>

I’m stuck! Not sure what I’m missing but I’m struggling to get a shared example group working with my controller specs. Here is a piece of the backtrace: /Users/20217633/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core…

---

## [Unable to get rid of backtrace when running specs (rspec2, rails3)](https://www.ruby-forum.com/t/unable-to-get-rid-of-backtrace-when-running-specs-rspec2-rails3/196050)

<div class="topic-metadata">

**Author:** [@Katrina\_Owen](https://www.ruby-forum.com/u/Katrina_Owen)\
**Replies:** 3\
**Last updated:** [October 8, 2010, 6:02am UTC](https://www.ruby-forum.com/t/unable-to-get-rid-of-backtrace-when-running-specs-rspec2-rails3/196050 "2010-10-08T06:02:15Z")

</div>

Hi, I can’t seem to silence the stack trace when running specs. Pending specs get this output: ChannelsController GET new responds to xml why would we want to render xml for Channel.new? ./spec/controllers/channel\_…

---

## [Rspec2 observations](https://www.ruby-forum.com/t/rspec2-observations/196082)

<div class="topic-metadata">

**Author:** [@cremes](https://www.ruby-forum.com/u/cremes)\
**Replies:** 2\
**Last updated:** [October 6, 2010, 6:26pm UTC](https://www.ruby-forum.com/t/rspec2-observations/196082 "2010-10-06T18:26:26Z")

</div>

Just a few observations now that I have completed the upgrade from RSpec-1 to RSpec-2. In my project (2800 examples across about 40 files), MRI 1.9.2-p0 takes roughly 3 times longer to complete the spec run. Runtime…

---

## [Using rcov with rspec2](https://www.ruby-forum.com/t/using-rcov-with-rspec2/195227)

<div class="topic-metadata">

**Author:** [@nathanvda](https://www.ruby-forum.com/u/nathanvda)\
**Replies:** 5\
**Last updated:** [October 6, 2010, 10:43am UTC](https://www.ruby-forum.com/t/using-rcov-with-rspec2/195227 "2010-10-06T10:43:57Z")

</div>

I have using rcov together with rspec2 using the following rake task: desc “Run all specs with rcov” RSpec::Core::RakeTask.new(“test\_cov”) do |t| t.rcov = true t.rcov\_opts = %w{–rails --include views --exclude gems/…

---

## [Response.should have\_text leads to undefined method \`has\_text?'](https://www.ruby-forum.com/t/response-should-have-text-leads-to-undefined-method-has-text/196014)

<div class="topic-metadata">

**Author:** [@turkan](https://www.ruby-forum.com/u/turkan)\
**Replies:** 1\
**Last updated:** [October 5, 2010, 2:49pm UTC](https://www.ruby-forum.com/t/response-should-have-text-leads-to-undefined-method-has-text/196014 "2010-10-05T14:49:19Z")

</div>

One of my controllers directly renders some JSON output that I would like to test with RSpec. For that I use ‘response.should have\_text(“foobar”)’ in my spec file, but that leads to a Failure/Error: response.should ha…

---

## [Routes are not available in RSpec integration test](https://www.ruby-forum.com/t/routes-are-not-available-in-rspec-integration-test/196016)

<div class="topic-metadata">

**Author:** [@Paul\_Yoder](https://www.ruby-forum.com/u/Paul_Yoder)\
**Replies:** 0\
**Last updated:** [October 5, 2010, 2:48pm UTC](https://www.ruby-forum.com/t/routes-are-not-available-in-rspec-integration-test/196016 "2010-10-05T14:48:09Z")

</div>

My RSpec integration tests do not seem to have access to the rails routes methods. Here’s a link to my more descriptive question on stack overflow: Does anyone know how to fix this?

---

## ["assign" to variable in view seems to give nil object](https://www.ruby-forum.com/t/assign-to-variable-in-view-seems-to-give-nil-object/195807)

<div class="topic-metadata">

**Author:** [@poseid](https://www.ruby-forum.com/u/poseid)\
**Replies:** 2\
**Last updated:** [September 30, 2010, 11:25pm UTC](https://www.ruby-forum.com/t/assign-to-variable-in-view-seems-to-give-nil-object/195807 "2010-09-30T23:25:17Z")

</div>

Hello, I am doing my first steps with rspec and did the following observation. I wanted to write a spec for a standard scaffold index view. Now, my view spec looks like: describe “/a\_details/index.html.erb” do it “…

---

## [Monitor method invoking from superclass](https://www.ruby-forum.com/t/monitor-method-invoking-from-superclass/195806)

<div class="topic-metadata">

**Author:** [@Zhi-Qiang\_L](https://www.ruby-forum.com/u/Zhi-Qiang_L)\
**Replies:** 9\
**Last updated:** [September 30, 2010, 5:18pm UTC](https://www.ruby-forum.com/t/monitor-method-invoking-from-superclass/195806 "2010-09-30T17:18:18Z")

</div>

Dear All, Class B is a subclass of class A. Could anyone tell me how to monitor if object created from class B receives a super message when its method is invoked. Thanks. Best regards, Lei, Zhi-Qiang

---

## [Re: Possible improvements to routing spec API](https://www.ruby-forum.com/t/re-possible-improvements-to-routing-spec-api/191117)

<div class="topic-metadata">

**Author:** [@Lalish-MenaghS\_Trev](https://www.ruby-forum.com/u/Lalish-MenaghS_Trev)\
**Replies:** 11\
**Last updated:** [September 29, 2010, 1:57pm UTC](https://www.ruby-forum.com/t/re-possible-improvements-to-routing-spec-api/191117 "2010-09-29T13:57:22Z")

</div>

OK, I will chime in here, since I think I might have opened up this can of worms. :slight\_smile: I agree with David that we should stick with wrapping the Rails public APIs. That is: assert\_generates, assert\_recognize…

---

## [Route\_to to test root route](https://www.ruby-forum.com/t/route-to-to-test-root-route/195732)

<div class="topic-metadata">

**Author:** [@anagri](https://www.ruby-forum.com/u/anagri)\
**Replies:** 1\
**Last updated:** [September 29, 2010, 12:51pm UTC](https://www.ruby-forum.com/t/route-to-to-test-root-route/195732 "2010-09-29T12:51:14Z")

</div>

I am working on a Rails 3 application using RSPec 2.beta.20. I am having the following routes in my routes.rb routes.rb resources :projects root :to =\> ‘projects#index’ I am trying to test both the routes. But while …

---

## [Having some issues with factory\_girl and bundler](https://www.ruby-forum.com/t/having-some-issues-with-factory-girl-and-bundler/195669)

<div class="topic-metadata">

**Author:** [@cdiaz](https://www.ruby-forum.com/u/cdiaz)\
**Replies:** 3\
**Last updated:** [September 28, 2010, 12:28am UTC](https://www.ruby-forum.com/t/having-some-issues-with-factory-girl-and-bundler/195669 "2010-09-28T00:28:50Z")

</div>

Hi All Need some brilliants minds here :slight\_smile: I’m using Rails 2.3.8 & ruby 1.8 (I know, I know… ) I’ve move my gems from .gems to Bundler, but I’m having some issues with Factory\_girl when I rake spec “unini…

---

## [Where do a set the description on a should satisfy](https://www.ruby-forum.com/t/where-do-a-set-the-description-on-a-should-satisfy/195543)

<div class="topic-metadata">

**Author:** [@destiney](https://www.ruby-forum.com/u/destiney)\
**Replies:** 7\
**Last updated:** [September 27, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/where-do-a-set-the-description-on-a-should-satisfy/195543 "2010-09-27T16:27:02Z")

</div>

Hi all, Newbie here and I’m using rspec with jruby to test a java class, but this is more of a rspec question. I have a java HashMap object and want to make sure a key exists. I have this as my test: context :toH…

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

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