# RSpec

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

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

---

## [Undefined method 'get'](https://www.ruby-forum.com/t/undefined-method-get/204469)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 4\
**Last updated:** [March 14, 2011, 7:29am UTC](https://www.ruby-forum.com/t/undefined-method-get/204469 "2011-03-14T07:29:28Z")

</div>

Hello guys, I was just starting a rails 3.0.5 application with rspec-rails 2.5.0 and ruby 1.9.2-p180 and when I went to describe my controller I ran into this undefined method ‘get’ error. Here’s the spec that is cau…

---

## [Faking FS in specs](https://www.ruby-forum.com/t/faking-fs-in-specs/204474)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 6\
**Last updated:** [March 13, 2011, 11:40pm UTC](https://www.ruby-forum.com/t/faking-fs-in-specs/204474 "2011-03-13T23:40:54Z")

</div>

Hi \*, for some reasons I’m not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? I’m currently trying to use FakeFS, but apparently I’m not even able to run specs after ch…

---

## [RCov](https://www.ruby-forum.com/t/rcov/204442)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 1\
**Last updated:** [March 12, 2011, 1:29am UTC](https://www.ruby-forum.com/t/rcov/204442 "2011-03-12T01:29:41Z")

</div>

I’m using Rake to run my specs e.g. task :test do Rake::Task\[‘spec’\].execute end how can I aspect this to include some sort of coverage report - RCov maybe? Of course, I could just escape to the command line with s…

---

## [RSpec is missing gems even though they are installed](https://www.ruby-forum.com/t/rspec-is-missing-gems-even-though-they-are-installed/204424)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 0\
**Last updated:** [March 11, 2011, 4:55pm UTC](https://www.ruby-forum.com/t/rspec-is-missing-gems-even-though-they-are-installed/204424 "2011-03-11T16:55:00Z")

</div>

Hi Folks, I am getting an error when trying to run my examples in RSpec: Command: spec spec Error: Missing these required gems: rspec-rails \>= 1.2.2 cucumber \>= 0.2.2 You’re running: ruby 1.8.7.334 at /Users/au…

---

## [Good tutorial for RSpec With Rails 3](https://www.ruby-forum.com/t/good-tutorial-for-rspec-with-rails-3/204352)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 4\
**Last updated:** [March 11, 2011, 6:55am UTC](https://www.ruby-forum.com/t/good-tutorial-for-rspec-with-rails-3/204352 "2011-03-11T06:55:29Z")

</div>

Hi, I am looking for a good free tutorial which implements RSpec with Rails 3. I have found many tutorials which work for Rails 2.x but leads you into issues when trying the same in Rails 3. Rspec Gem also has updated …

---

## [Trying to test flash messaging with rspec](https://www.ruby-forum.com/t/trying-to-test-flash-messaging-with-rspec/204382)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 2\
**Last updated:** [March 11, 2011, 3:19am UTC](https://www.ruby-forum.com/t/trying-to-test-flash-messaging-with-rspec/204382 "2011-03-11T03:19:43Z")

</div>

Hello every one, So my this rspec test fails: it "should have a welcome message" do post :create, :user =\> @attr response.flash\[:success\].should eql("Welcome new user!") end However when I create …

---

## [How to use rspec\_scaffold generator with latest rspec gem](https://www.ruby-forum.com/t/how-to-use-rspec-scaffold-generator-with-latest-rspec-gem/204361)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 5\
**Last updated:** [March 11, 2011, 2:14am UTC](https://www.ruby-forum.com/t/how-to-use-rspec-scaffold-generator-with-latest-rspec-gem/204361 "2011-03-11T02:14:41Z")

</div>

Hi, I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice. I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby 1.9.2 on ubuntu 10.04 os. I am currently referring to the tutorial on :- …

---

## [Rspec single file](https://www.ruby-forum.com/t/rspec-single-file/204374)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 1\
**Last updated:** [March 10, 2011, 11:55pm UTC](https://www.ruby-forum.com/t/rspec-single-file/204374 "2011-03-10T23:55:48Z")

</div>

Hi Guys, How can run the single spec file without loading the environment. I know ruby spec commands will load the total environment. I want to run the files one by one those are not in same folder and i want to lo…

---

## [How to do controller.stub(:some\_method) at request test when using rspec2](https://www.ruby-forum.com/t/how-to-do-controller-stub-some-method-at-request-test-when-using-rspec2/204004)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 6\
**Last updated:** [March 10, 2011, 9:35am UTC](https://www.ruby-forum.com/t/how-to-do-controller-stub-some-method-at-request-test-when-using-rspec2/204004 "2011-03-10T09:35:53Z")

</div>

Hi, I hava a controller class DynamicFlowsController \< ApplicationController def create @workflow = Workflow.find\_by\_id(params\[:workflow\_id\]) table = @workflow.flex\_table save\_u\_and\_node(table, @workflow.node\_defin…

---

## [Are there any ways to detect spec faults during a run?](https://www.ruby-forum.com/t/are-there-any-ways-to-detect-spec-faults-during-a-run/226202)

<div class="topic-metadata">

**Author:** [@Magnus\_Erickson](https://www.ruby-forum.com/u/Magnus_Erickson)\
**Replies:** 0\
**Last updated:** [March 9, 2011, 2:18pm UTC](https://www.ruby-forum.com/t/are-there-any-ways-to-detect-spec-faults-during-a-run/226202 "2011-03-09T14:18:27Z")

</div>

Hi, Is there a way to detect if an example has failed? Something like a: “example\_failed?” method. In my case I need to dump some information, i.e trace and error log, to be used when analyzing what went wrong in t…

---

## [Are there any ways to detect spec faults during a run?](https://www.ruby-forum.com/t/are-there-any-ways-to-detect-spec-faults-during-a-run/204305)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 0\
**Last updated:** [March 9, 2011, 2:15pm UTC](https://www.ruby-forum.com/t/are-there-any-ways-to-detect-spec-faults-during-a-run/204305 "2011-03-09T14:15:18Z")

</div>

Hi, Is there a way to detect if an example has failed? Something like a: “example\_failed?” method. In my case I need to dump some information, i.e trace and error log, to be used when analyzing what went wrong in t…

---

## [Problem running rspec test with Webrat](https://www.ruby-forum.com/t/problem-running-rspec-test-with-webrat/204244)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 1\
**Last updated:** [March 8, 2011, 4:46pm UTC](https://www.ruby-forum.com/t/problem-running-rspec-test-with-webrat/204244 "2011-03-08T16:46:49Z")

</div>

Hi, I am trying to run rspec testcase using webrat but it is showing me an error as “undefined method \`last\_response’ for #Capybara::Document” Following are my configurations: Gemfile: roup :development, :test do g…

---

## [\[Rails\] Can't get controller test working with RSpec 2 and edge Rails 3](https://www.ruby-forum.com/t/rails-cant-get-controller-test-working-with-rspec-2-and-edge-rails-3/190733)

<div class="topic-metadata">

**Author:** [@pgundlach](https://www.ruby-forum.com/u/pgundlach)\
**Replies:** 3\
**Last updated:** [March 7, 2011, 10:55am UTC](https://www.ruby-forum.com/t/rails-cant-get-controller-test-working-with-rspec-2-and-edge-rails-3/190733 "2011-03-07T10:55:36Z")

</div>

Not sure if this is a Rails 3 issue or an RSpec 2 issue, but I can’t seem to get a standard controller test working - it seems that the ‘get’ method can’t be found. I have a controller test that looks like this (name…

---

## [How to intercept an instance method from StdLib (1.9.2)](https://www.ruby-forum.com/t/how-to-intercept-an-instance-method-from-stdlib-1-9-2/204061)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 5\
**Last updated:** [March 6, 2011, 11:53am UTC](https://www.ruby-forum.com/t/how-to-intercept-an-instance-method-from-stdlib-1-9-2/204061 "2011-03-06T11:53:56Z")

</div>

Hi, I’m struggling with something that seems to be simple, and I’ve not had any joy following the RSpec books suggestions (p. 187). I’d like to test that a method raises and error when a file is not found. I’ve trie…

---

## [Db:test:prepare interfering with rake spec pattern](https://www.ruby-forum.com/t/dbprepare-interfering-with-rake-spec-pattern/204123)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 1\
**Last updated:** [March 5, 2011, 4:28pm UTC](https://www.ruby-forum.com/t/dbprepare-interfering-with-rake-spec-pattern/204123 "2011-03-05T16:28:22Z")

</div>

I have a tricky problem with running rake spec in a Rails 3.0.3 project (using rspec-2.5.0, rspec-rails and rake 0.8.7). It may be that this mailing list is not the correct one to ask for help, but I am hoping that i…

---

## [Possible bug in proxy.rb in Rspec 1.3.1](https://www.ruby-forum.com/t/possible-bug-in-proxy-rb-in-rspec-1-3-1/204126)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 0\
**Last updated:** [March 5, 2011, 4:26pm UTC](https://www.ruby-forum.com/t/possible-bug-in-proxy-rb-in-rspec-1-3-1/204126 "2011-03-05T16:26:29Z")

</div>

In the proxy.rb file, Rspec 1.3.1 added a stanza to the it/else stack elsif @target.is\_a?(Class) @target.superclass.send(sym, \*args, &block) This just seems wrong to me and I’m pretty sure it’s causing catas…

---

## [Installing RSpec requires changing generators in config/applicaton.rb?](https://www.ruby-forum.com/t/installing-rspec-requires-changing-generators-in-config-applicaton-rb/204121)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 1\
**Last updated:** [March 5, 2011, 4:04pm UTC](https://www.ruby-forum.com/t/installing-rspec-requires-changing-generators-in-config-applicaton-rb/204121 "2011-03-05T16:04:29Z")

</div>

All the RSpec installation instructions I’ve seen (except the RSpec Book) say something like: Set up the RSpec generator by adding the following to config/ applicaton.rb: config.generators do |g| g.test\_framework :r…

---

## [How to run example group in transaction](https://www.ruby-forum.com/t/how-to-run-example-group-in-transaction/204081)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 1\
**Last updated:** [March 4, 2011, 9:36pm UTC](https://www.ruby-forum.com/t/how-to-run-example-group-in-transaction/204081 "2011-03-04T21:36:45Z")

</div>

Dear All, I want to wrap my example group in transaction to avoid record being created. How should I do? My rspec is 2.5.1, and ORM is Sequal. This way does not work for me. Thanks. class RSpec::Core::ExampleGroup d…

---

## [Rails 3.0.1 and rspec-rails assign issue: render doesn't have instance var](https://www.ruby-forum.com/t/rails-3-0-1-and-rspec-rails-assign-issue-render-doesnt-have-instance-var/204079)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 0\
**Last updated:** [March 4, 2011, 3:15pm UTC](https://www.ruby-forum.com/t/rails-3-0-1-and-rspec-rails-assign-issue-render-doesnt-have-instance-var/204079 "2011-03-04T15:15:52Z")

</div>

If you find the exception “undefined method ‘model\_name’ for NilClass:Class” in view specs with Rails 3.0.1 and rspec-rails2, I believe it’s a Rails issue. I receive the exception after calling render in my view spec,…

---

## [Ruby Debugger - not working in rspec?](https://www.ruby-forum.com/t/ruby-debugger-not-working-in-rspec/204065)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 2\
**Last updated:** [March 4, 2011, 12:49pm UTC](https://www.ruby-forum.com/t/ruby-debugger-not-working-in-rspec/204065 "2011-03-04T12:49:06Z")

</div>

Howdy, I’m trying to get the ruby debugger to breakpoint at a specific line in source. Here’s what I did: Added require “ruby-debug” in spec\_helper.rb Added gem dependency to Gemfile (gem “ruby-debug” In the spec, a…

---

## [Does RSpec interfere with Pathname#dirname or Pathname#realpath?](https://www.ruby-forum.com/t/does-rspec-interfere-with-pathname-dirname-or-pathname-realpath/204051)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 1\
**Last updated:** [March 4, 2011, 1:32am UTC](https://www.ruby-forum.com/t/does-rspec-interfere-with-pathname-dirname-or-pathname-realpath/204051 "2011-03-04T01:32:16Z")

</div>

Hi, I starting a new project, and have run into behavior I cannot replicate in irb, (i.e. outside of using rspec) when the directory? returns true, so I thought I’d ask here, in case any one has seen this badhavior. …

---

## [Callback when tests are done](https://www.ruby-forum.com/t/callback-when-tests-are-done/204028)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 0\
**Last updated:** [March 3, 2011, 6:38pm UTC](https://www.ruby-forum.com/t/callback-when-tests-are-done/204028 "2011-03-03T18:38:17Z")

</div>

Currently when I run my tests, I run $ rspec spec/ -cf nested Is there a way to have a callback that when this task is done running, I can hook into how many tests failed, or how many passed, and have my own code run…

---

## [Cucumber not inserting record in db](https://www.ruby-forum.com/t/cucumber-not-inserting-record-in-db/203999)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 1\
**Last updated:** [March 3, 2011, 1:22pm UTC](https://www.ruby-forum.com/t/cucumber-not-inserting-record-in-db/203999 "2011-03-03T13:22:58Z")

</div>

Hi, I am trying to learn Cucumber. I have followed the tutorial on “http://www.ultrasaurus.com/sarahblog/2008/12/rails-2-day-3-behavior-driven-development/” Everything is working fine but my problem is it is not inser…

---

## [Rspec2 for rails 2.3.8?](https://www.ruby-forum.com/t/rspec2-for-rails-2-3-8/203734)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 7\
**Last updated:** [March 2, 2011, 11:53pm UTC](https://www.ruby-forum.com/t/rspec2-for-rails-2-3-8/203734 "2011-03-02T23:53:41Z")

</div>

Hi experts, I picked up a copy of the rspec book and wrote some tests in spec/lib and spec/models for my Rails 2.3.8 code. I was using rspec 2.5.1, rspec-core 2.5.0, rspec-expectations 2.5.0 et. al. But I realised t…

---

## [\[ANN\] Welcome Chad, Pat, Justin, and Myron!](https://www.ruby-forum.com/t/ann-welcome-chad-pat-justin-and-myron/203900)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 4\
**Last updated:** [March 1, 2011, 7:48pm UTC](https://www.ruby-forum.com/t/ann-welcome-chad-pat-justin-and-myron/203900 "2011-03-01T19:48:35Z")

</div>

I’m very pleased to announce the reformation of a core RSpec development team: Chad H., a.k.a. spicycode, has been involved with RSpec since the 1.0 release, which he helped to usher out the door at RailsConf 2007. He …

---

## [Writing Rspec for signup using facebook](https://www.ruby-forum.com/t/writing-rspec-for-signup-using-facebook/203891)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 1\
**Last updated:** [March 1, 2011, 12:19pm UTC](https://www.ruby-forum.com/t/writing-rspec-for-signup-using-facebook/203891 "2011-03-01T12:19:45Z")

</div>

Hi, We are using omniauth for signup through Facebook and twitter. Is there any way i can check this by rspec controllers since it contains callbacks n all…so i think we may have to use mock models. If there is any l…

---

## [RSpec doesn't see the DATA constant](https://www.ruby-forum.com/t/rspec-doesnt-see-the-data-constant/203641)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 3\
**Last updated:** [February 28, 2011, 7:34pm UTC](https://www.ruby-forum.com/t/rspec-doesnt-see-the-data-constant/203641 "2011-02-28T19:34:03Z")

</div>

Hi. In Ruby there’s the DATA constant which contains the lines following the \_\_END\_\_ keyword in the source file. For some reason RSpec doesn’t see it. Here’s the example: # data\_spec.rb requre 'rspec' describe 'DA…

---

## [Rspec is swallowing undefined methods in it's method\_missing and looping forever](https://www.ruby-forum.com/t/rspec-is-swallowing-undefined-methods-in-its-method-missing-and-looping-forever/203504)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 1\
**Last updated:** [February 27, 2011, 7:03am UTC](https://www.ruby-forum.com/t/rspec-is-swallowing-undefined-methods-in-its-method-missing-and-looping-forever/203504 "2011-02-27T07:03:48Z")

</div>

Has anyone else encountered this? It will end up printing this : Applications Scribd api requests should always be private Failure/Error: Unable to find matching line from backtrace SystemStackError: stack level to…

---

## [Stubbing Scopes](https://www.ruby-forum.com/t/stubbing-scopes/203214)

<div class="topic-metadata">

**Author:** [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Replies:** 4\
**Last updated:** [February 24, 2011, 9:42pm UTC](https://www.ruby-forum.com/t/stubbing-scopes/203214 "2011-02-24T21:42:08Z")

</div>

Hi! I’m trying to test the following (simplified) model: class Allocation \< ActiveRecord::Base scope :in\_interval, (proc do |start\_of\_interval, end\_of\_interval| params = {:s =\> start\_of\_interval, :e =\> end\_of\_interva…

---

## [Validations aren't being performed when running 'rspec spec'](https://www.ruby-forum.com/t/validations-arent-being-performed-when-running-rspec-spec/203640)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 6\
**Last updated:** [February 24, 2011, 8:35pm UTC](https://www.ruby-forum.com/t/validations-arent-being-performed-when-running-rspec-spec/203640 "2011-02-24T20:35:01Z")

</div>

Hello, When I run ‘rspec spec/models’ everything runs beautifully. When I run ‘rspec spec/controllers’ everything also runs beautifully. When I run ‘rspec spec’ the models seem to forget that the records need to pass…

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

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