# RSpec

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

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

---

## [Name collision - how would you handle this?](https://www.ruby-forum.com/t/name-collision-how-would-you-handle-this/192898)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 20\
**Last updated:** [August 16, 2010, 6:26pm UTC](https://www.ruby-forum.com/t/name-collision-how-would-you-handle-this/192898 "2010-08-16T18:26:37Z")

</div>

Hey all, It turns out that if you have Rails (2 or 3) Ruby-1.9 a model named Message let(:message) or def message in an example group a Rails assertion in an example in that group note that rspec-rails’ matchers dele…

---

## [Html formatter](https://www.ruby-forum.com/t/html-formatter/193368)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 0\
**Last updated:** [August 16, 2010, 6:17pm UTC](https://www.ruby-forum.com/t/html-formatter/193368 "2010-08-16T18:17:15Z")

</div>

For rspec 2.0, is there anyway we can specify which file the output should be written into when using html formatter easily? Thanks Yi

---

## [2.0.0.beta.19 installation problem](https://www.ruby-forum.com/t/2-0-0-beta-19-installation-problem/193335)

<div class="topic-metadata">

**Author:** [@Craig\_Castelaz](https://www.ruby-forum.com/u/Craig_Castelaz)\
**Replies:** 1\
**Last updated:** [August 16, 2010, 1:53pm UTC](https://www.ruby-forum.com/t/2-0-0-beta-19-installation-problem/193335 "2010-08-16T13:53:44Z")

</div>

I purchased the beta version of the PragBook yesterday, but didn’t get a chance to begin reading until tonight. I’m currently stuck on installing rspec. ~$ sudo gem install rspec --version 2.0.0.beta.19 Thank you f…

---

## [Rspec command for rspec-2.0.0.beta.19](https://www.ruby-forum.com/t/rspec-command-for-rspec-2-0-0-beta-19/193331)

<div class="topic-metadata">

**Author:** [@bpauly](https://www.ruby-forum.com/u/bpauly)\
**Replies:** 3\
**Last updated:** [August 16, 2010, 11:13am UTC](https://www.ruby-forum.com/t/rspec-command-for-rspec-2-0-0-beta-19/193331 "2010-08-16T11:13:20Z")

</div>

I’ve just uninstalled all versions of rspec and installed rspec-2.0.0.beta.19 and rspec-rails-2.0.0.beta.19 for a rails project and I can’t find the rspec command. Based on what bundler is telling me, I think it shoul…

---

## [Including modules for view test in RSpec 2.0.0.beta.19](https://www.ruby-forum.com/t/including-modules-for-view-test-in-rspec-2-0-0-beta-19/193334)

<div class="topic-metadata">

**Author:** [@Dane\_H](https://www.ruby-forum.com/u/Dane_H)\
**Replies:** 2\
**Last updated:** [August 16, 2010, 11:12am UTC](https://www.ruby-forum.com/t/including-modules-for-view-test-in-rspec-2-0-0-beta-19/193334 "2010-08-16T11:12:10Z")

</div>

Hey guys, I used RSpec 1.3 quite a bit and wanted to move to 2.0. I’m having some trouble, but I think I’m just missing something. On this pastie you’ll see my spec/support/view\_helpers.rb, spec/ spec\_helper.rb file …

---

## [Module & Mixin testing strategy](https://www.ruby-forum.com/t/module-mixin-testing-strategy/193264)

<div class="topic-metadata">

**Author:** [@ghoti143](https://www.ruby-forum.com/u/ghoti143)\
**Replies:** 5\
**Last updated:** [August 16, 2010, 10:20am UTC](https://www.ruby-forum.com/t/module-mixin-testing-strategy/193264 "2010-08-16T10:20:09Z")

</div>

Hi, Just wondered what people thoughts are to testing module’s to be included in mixin’s? Seems to me there are two main approaches:- Test the behavior in a mixin object that includes the module because its the beh…

---

## [Specifying which spec types helper modules get included into in the RSpec.configure block](https://www.ruby-forum.com/t/specifying-which-spec-types-helper-modules-get-included-into-in-the-rspec-configure-block/192593)

<div class="topic-metadata">

**Author:** [@S\_Bennett](https://www.ruby-forum.com/u/S_Bennett)\
**Replies:** 2\
**Last updated:** [August 16, 2010, 6:55am UTC](https://www.ruby-forum.com/t/specifying-which-spec-types-helper-modules-get-included-into-in-the-rspec-configure-block/192593 "2010-08-16T06:55:48Z")

</div>

Hi folks, Using Rails 3.0.0.rc & RSpec 2.0.0.beta.19 I’m trying to specify what type of specs helper modules get included into such as below: config.include Devise::TestHelpers, :type =\> :controller When I run the c…

---

## [Calling script/spec from directories other than RAILS\_ROOT](https://www.ruby-forum.com/t/calling-script-spec-from-directories-other-than-rails-root/193332)

<div class="topic-metadata">

**Author:** [@samullen](https://www.ruby-forum.com/u/samullen)\
**Replies:** 1\
**Last updated:** [August 16, 2010, 6:51am UTC](https://www.ruby-forum.com/t/calling-script-spec-from-directories-other-than-rails-root/193332 "2010-08-16T06:51:43Z")

</div>

I’ve written a simple shell function which, depending on where it is called, will ascend the directory tree until it finds ./script/spec or, failing that, the spec first found in $PATH. What I’m running into is that a…

---

## [Issue with rescue\_action\_in\_public! and testing 404 responses](https://www.ruby-forum.com/t/issue-with-rescue-action-in-public-and-testing-404-responses/193015)

<div class="topic-metadata">

**Author:** [@christofferklang](https://www.ruby-forum.com/u/christofferklang)\
**Replies:** 2\
**Last updated:** [August 16, 2010, 6:39am UTC](https://www.ruby-forum.com/t/issue-with-rescue-action-in-public-and-testing-404-responses/193015 "2010-08-16T06:39:25Z")

</div>

Hello, I’m new to rails and I’m trying to wrap my heads around how to spec controllers using RSpec (using rails 3rc1 and rspec 2.0.0.beta.19). The problem I’ve run into is when I want to test that my controllers resp…

---

## [Autotest does not start](https://www.ruby-forum.com/t/autotest-does-not-start/193093)

<div class="topic-metadata">

**Author:** [@Don\_F](https://www.ruby-forum.com/u/Don_F)\
**Replies:** 20\
**Last updated:** [August 14, 2010, 9:54pm UTC](https://www.ruby-forum.com/t/autotest-does-not-start/193093 "2010-08-14T21:54:06Z")

</div>

I have a non rails app using rspec2. I created the autotest/ discover.rb and put in it Autotest.add\_discovery {“rspec2”}. When I run under bundler I get - loading autotest/rspec2 and a prompt back When standalone …

---

## [Generator-spec release 0.4.8](https://www.ruby-forum.com/t/generator-spec-release-0-4-8/193124)

<div class="topic-metadata">

**Author:** [@kristianm](https://www.ruby-forum.com/u/kristianm)\
**Replies:** 1\
**Last updated:** [August 14, 2010, 6:42pm UTC](https://www.ruby-forum.com/t/generator-spec-release-0-4-8/193124 "2010-08-14T18:42:41Z")

</div>

Now with an almost complete test suite to ensure it all works as it should and to demonstrate how to use it. The DSL is better than ever! describe ‘model\_generator’ do include Rails model helpers for ActiveRecord ava…

---

## [Testing named\_scope](https://www.ruby-forum.com/t/testing-named-scope/181769)

<div class="topic-metadata">

**Author:** [@Nin](https://www.ruby-forum.com/u/Nin)\
**Replies:** 7\
**Last updated:** [August 14, 2010, 5:44pm UTC](https://www.ruby-forum.com/t/testing-named-scope/181769 "2010-08-14T17:44:16Z")

</div>

Hi! I’m new to rspec and was wondering how named\_scopes are usually tested? Is it enough to test that it’s defined? or do you need to test the behavior as well? I’ve been reading around and this seems to be the tester…

---

## [\[rspec\] Installation Problem](https://www.ruby-forum.com/t/rspec-installation-problem/193254)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [August 14, 2010, 7:57am UTC](https://www.ruby-forum.com/t/rspec-installation-problem/193254 "2010-08-14T07:57:41Z")

</div>

Hi friends, I have installed and used RSpec many times before. After a long time, I am back to RSpec and I tried installing this gem. But am not able to install it. Following are the details: $ gem install rspec T…

---

## [How to place the app in the rails dir](https://www.ruby-forum.com/t/how-to-place-the-app-in-the-rails-dir/193034)

<div class="topic-metadata">

**Author:** [@arunachandu](https://www.ruby-forum.com/u/arunachandu)\
**Replies:** 2\
**Last updated:** [August 12, 2010, 10:35am UTC](https://www.ruby-forum.com/t/how-to-place-the-app-in-the-rails-dir/193034 "2010-08-12T10:35:37Z")

</div>

Hi i am new to ROR . I have mentioned to work on Rspec… i have a code given by my boss… I am having doubts in using them. How should i keep that code in my railsprojects directory… Should i keep the package given b…

---

## [Rspec2, Autotest showing failure on all passing specs](https://www.ruby-forum.com/t/rspec2-autotest-showing-failure-on-all-passing-specs/193095)

<div class="topic-metadata">

**Author:** [@pixel](https://www.ruby-forum.com/u/pixel)\
**Replies:** 3\
**Last updated:** [August 11, 2010, 10:08pm UTC](https://www.ruby-forum.com/t/rspec2-autotest-showing-failure-on-all-passing-specs/193095 "2010-08-11T22:08:41Z")

</div>

Hey guys, This is making me nuts, and I’ve run out of things to google. I’m writing myself a little gem library, primarily for my own education. I got a healthy start on my specs and figured I could do myself a favo…

---

## [Rspec2 not working with shoulda](https://www.ruby-forum.com/t/rspec2-not-working-with-shoulda/193102)

<div class="topic-metadata">

**Author:** [@Nadal](https://www.ruby-forum.com/u/Nadal)\
**Replies:** 6\
**Last updated:** [August 11, 2010, 8:33pm UTC](https://www.ruby-forum.com/t/rspec2-not-working-with-shoulda/193102 "2010-08-11T20:33:15Z")

</div>

I am using rails edge. I am using gem “rspec-rails”, “= 2.0.0.beta. 19” . I have following code at spec/models/user\_spec.rb require ‘spec\_helper’ describe User do it { should validate\_presence\_of(:email) } it { sho…

---

## [Nice little DSL trick for extending ExampleGroups in RSpec](https://www.ruby-forum.com/t/nice-little-dsl-trick-for-extending-examplegroups-in-rspec/193087)

<div class="topic-metadata">

**Author:** [@kristianm](https://www.ruby-forum.com/u/kristianm)\
**Replies:** 0\
**Last updated:** [August 11, 2010, 2:02am UTC](https://www.ruby-forum.com/t/nice-little-dsl-trick-for-extending-examplegroups-in-rspec/193087 "2010-08-11T02:02:46Z")

</div>

describe ‘migration\_generator’ do include RSpec::Rails::Orm::ActiveRecord include RSpec::Rails::Migration … end Didn’t quite feel right. So I made it prettier DSL like using the solution below :wink: class Class …

---

## [Order guarantees of let](https://www.ruby-forum.com/t/order-guarantees-of-let/192984)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 6\
**Last updated:** [August 10, 2010, 4:32pm UTC](https://www.ruby-forum.com/t/order-guarantees-of-let/192984 "2010-08-10T16:32:30Z")

</div>

Hi I was just about to replace a before block along the lines of: before(:each) do @cti\_b\_id = service.create(name: “Item-B”) @cti\_z\_id = service.create(name: “Z-Item”) @cti\_a\_id = service.create(name: “Item-A”) # …

---

## [Recognising RSpec files in the Textmate bundle](https://www.ruby-forum.com/t/recognising-rspec-files-in-the-textmate-bundle/192900)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 13\
**Last updated:** [August 10, 2010, 3:43pm UTC](https://www.ruby-forum.com/t/recognising-rspec-files-in-the-textmate-bundle/192900 "2010-08-10T15:43:17Z")

</div>

Hi Did the RSpec TMBundle ever have multiple ways of recognising RSpec files? I’m convinced it user to look for “spec\_helper” on the first line. The Ruby bundle does something similar, as it looks for “firstLineMat…

---

## [Cant able to create a Rspec files](https://www.ruby-forum.com/t/cant-able-to-create-a-rspec-files/193045)

<div class="topic-metadata">

**Author:** [@arunachandu](https://www.ruby-forum.com/u/arunachandu)\
**Replies:** 1\
**Last updated:** [August 10, 2010, 3:27pm UTC](https://www.ruby-forum.com/t/cant-able-to-create-a-rspec-files/193045 "2010-08-10T15:27:28Z")

</div>

Hi, I am new to ROR. I am working on Rspec… I have been provided with a full package of an application. I kept it in my rails dir. The dir itself contains spec folder with some controllers/models and fixtures but w…

---

## [Bad gemspec for rspec-core](https://www.ruby-forum.com/t/bad-gemspec-for-rspec-core/193016)

<div class="topic-metadata">

**Author:** [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Replies:** 0\
**Last updated:** [August 10, 2010, 2:30am UTC](https://www.ruby-forum.com/t/bad-gemspec-for-rspec-core/193016 "2010-08-10T02:30:04Z")

</div>

I receive this message when bundling using this example project: The included Gemfile references HEAD of rspec-core, and the gemspec there has this issue: Using rspec-core (2.0.0.beta.19) from git://github.com/rspec…

---

## [Testing 404 redirects in the controller with rspec beta 19](https://www.ruby-forum.com/t/testing-404-redirects-in-the-controller-with-rspec-beta-19/192961)

<div class="topic-metadata">

**Author:** [@christofferklang](https://www.ruby-forum.com/u/christofferklang)\
**Replies:** 2\
**Last updated:** [August 9, 2010, 1:39pm UTC](https://www.ruby-forum.com/t/testing-404-redirects-in-the-controller-with-rspec-beta-19/192961 "2010-08-09T13:39:36Z")

</div>

Hello, I’m new to rails and I’m trying to wrap my heads around how to spec controllers using RSpec (using rails 3rc1 and rspec 2.0.0.beta.19). The problem I’ve run into is when I want to test that my controllers resp…

---

## [RSpec 2 autotest file](https://www.ruby-forum.com/t/rspec-2-autotest-file/192902)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [August 8, 2010, 1:12pm UTC](https://www.ruby-forum.com/t/rspec-2-autotest-file/192902 "2010-08-08T13:12:06Z")

</div>

Hi I’ve tried using the autotest file from RSpec 2 (lib/autotest/rspec2.rb) but I’ve found a problem with it, that I think is a bug. The file contains two sections an Autotest Autotest.add\_hook :initialize block an …

---

## [Release of RSpec for Generators 0.4.0](https://www.ruby-forum.com/t/release-of-rspec-for-generators-0-4-0/192888)

<div class="topic-metadata">

**Author:** [@kristianm](https://www.ruby-forum.com/u/kristianm)\
**Replies:** 0\
**Last updated:** [August 7, 2010, 5:28pm UTC](https://www.ruby-forum.com/t/release-of-rspec-for-generators-0-4-0/192888 "2010-08-07T17:28:38Z")

</div>

Now with a full RSpec 2 test suite to demonstrate most of its features. Wiki to be updated with latest changes ASAP. http://github.com/kristianmandrup/rspec\_for\_generators This gem makes it very easy to spec that your…

---

## [How do I extend ExampleGroup in Rspec 2?](https://www.ruby-forum.com/t/how-do-i-extend-examplegroup-in-rspec-2/192878)

<div class="topic-metadata">

**Author:** [@kristianm](https://www.ruby-forum.com/u/kristianm)\
**Replies:** 4\
**Last updated:** [August 7, 2010, 5:20pm UTC](https://www.ruby-forum.com/t/how-do-i-extend-examplegroup-in-rspec-2/192878 "2010-08-07T17:20:26Z")

</div>

I simply want all methods of a module to be always available within the context of an Example group. module RSpec module Generator def with\_generator &block … end def setup\_generator test\_method\_name=nil, &block…

---

## [Could not find generator rspec:install](https://www.ruby-forum.com/t/could-not-find-generator-rspec-install/192875)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 1\
**Last updated:** [August 7, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/could-not-find-generator-rspec-install/192875 "2010-08-07T15:31:32Z")

</div>

I’m trying to follow this tutorial here: http://railstutorial.org/chapters/static-pages#top When I run: $ rails generate rspec:install I get: Could not find generator rspec:install. What could be the problem? Than…

---

## [Cucumber Development](https://www.ruby-forum.com/t/cucumber-development/192834)

<div class="topic-metadata">

**Author:** [@subhash\_c\_mishra](https://www.ruby-forum.com/u/subhash_c_mishra)\
**Replies:** 4\
**Last updated:** [August 6, 2010, 8:02pm UTC](https://www.ruby-forum.com/t/cucumber-development/192834 "2010-08-06T20:02:07Z")

</div>

Hi All, I’m using cucumber for some time. it’s quite good and i want to do some further development, so that user can even parse the arguments. I’m looking for developers guide of cucumber or even if some one knows th…

---

## [Evaluating shared example customisation block before shared block](https://www.ruby-forum.com/t/evaluating-shared-example-customisation-block-before-shared-block/192444)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 48\
**Last updated:** [August 6, 2010, 1:01pm UTC](https://www.ruby-forum.com/t/evaluating-shared-example-customisation-block-before-shared-block/192444 "2010-08-06T13:01:11Z")

</div>

Hi I finally looked into why this is not currently possibly in RSpec 2 (beta 19): shared\_examples\_for “Etymology” do describe “The etymology of foo” do it “is followed by #{after\_foo}” do # … end end end descri…

---

## [New bie question: Why use assert\_equal when there are comparison operators in Rspec?](https://www.ruby-forum.com/t/new-bie-question-why-use-assert-equal-when-there-are-comparison-operators-in-rspec/192814)

<div class="topic-metadata">

**Author:** [@ct9a](https://www.ruby-forum.com/u/ct9a)\
**Replies:** 1\
**Last updated:** [August 6, 2010, 11:38am UTC](https://www.ruby-forum.com/t/new-bie-question-why-use-assert-equal-when-there-are-comparison-operators-in-rspec/192814 "2010-08-06T11:38:39Z")

</div>

hi guys, I’m reading up on Rspec, Mocha and some related material to put BDD in my new rails app. I have also checked out Ryan B.’ railscasts on rspec (that’s how I got to know about Mocha). Reading up on the Rspec’…

---

## [Macros and accessing block-variables (rspec2)](https://www.ruby-forum.com/t/macros-and-accessing-block-variables-rspec2/192790)

<div class="topic-metadata">

**Author:** [@Gudleik\_R](https://www.ruby-forum.com/u/Gudleik_R)\
**Replies:** 2\
**Last updated:** [August 6, 2010, 11:28am UTC](https://www.ruby-forum.com/t/macros-and-accessing-block-variables-rspec2/192790 "2010-08-06T11:28:07Z")

</div>

Hi, I’m trying to create an rspec macro (for rspec2) but it cannot access variables defined in a before-block. Am I missing something or is it supposed to be like that? Here’s a full example: http://gist.github.com/5…

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

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