# RSpec

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

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

---

## [\-n command line option broken?](https://www.ruby-forum.com/t/n-command-line-option-broken/152097)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 4:35am UTC](https://www.ruby-forum.com/t/n-command-line-option-broken/152097 "2008-10-30T04:35:03Z")

</div>

It seems that ‘-n’ command line option for rspec stopped working as of rspec 1.1.3. I think this may be related to why I can’t get NetBeans to run focussed specs anymore. Does this work for others? I’m using jruby but…

---

## [Re: Accessing the model class from within an rspec-rails spec](https://www.ruby-forum.com/t/re-accessing-the-model-class-from-within-an-rspec-rails-spec/152098)

<div class="topic-metadata">

**Author:** [@cdb](https://www.ruby-forum.com/u/cdb)\
**Replies:** 0\
**Last updated:** [October 30, 2008, 4:35am UTC](https://www.ruby-forum.com/t/re-accessing-the-model-class-from-within-an-rspec-rails-spec/152098 "2008-10-30T04:35:03Z")

</div>

Hi everybody, David and Pat, thanks for the tip on using “described\_type” to access the model class. I actually figured that one out like 10 minutes after sending the email. 2 learnings there, first, sometimes expla…

---

## [\-l command line option broken?](https://www.ruby-forum.com/t/l-command-line-option-broken/152021)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 0\
**Last updated:** [October 29, 2008, 4:58am UTC](https://www.ruby-forum.com/t/l-command-line-option-broken/152021 "2008-10-29T04:58:07Z")

</div>

It’s been working for me. I wrote a Vim script that runs the current spec (in whatever window it might be) with DRb, so it takes about a second. It’s made a big difference in my TDD/BDD work cycle. ///ark Sorry f…

---

## [Vim tree plugin?](https://www.ruby-forum.com/t/vim-tree-plugin/151853)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 1\
**Last updated:** [October 27, 2008, 3:43pm UTC](https://www.ruby-forum.com/t/vim-tree-plugin/151853 "2008-10-27T15:43:09Z")

</div>

Does anyone know if there’s a vim plugin out there that will show a tree of your describe/it blocks at a glance. Preferably with click ability to go right to that location? Thanks, Steve

---

## [Re: Testing item links in Webrat (was: Cucumber)](https://www.ruby-forum.com/t/re-testing-item-links-in-webrat-was-cucumber/151854)

<div class="topic-metadata">

**Author:** [@aslak\_hellesoy](https://www.ruby-forum.com/u/aslak_hellesoy)\
**Replies:** 4\
**Last updated:** [October 27, 2008, 9:11am UTC](https://www.ruby-forum.com/t/re-testing-item-links-in-webrat-was-cucumber/151854 "2008-10-27T09:11:25Z")

</div>

On Sun, Oct 26, 2008 at 11:30 PM, Mark T. removed\_email\_address@domain.invalid wrote: I have an index template that contains a tabulated list of database items, each of which has an associated “display” link that ena…

---

## [Specs for ActionMailer views](https://www.ruby-forum.com/t/specs-for-actionmailer-views/151851)

<div class="topic-metadata">

**Author:** [@srveit](https://www.ruby-forum.com/u/srveit)\
**Replies:** 1\
**Last updated:** [October 27, 2008, 3:57am UTC](https://www.ruby-forum.com/t/specs-for-actionmailer-views/151851 "2008-10-27T03:57:59Z")

</div>

Folks, Has anyone written specs for ActionMailer views? What type should I use. I can’t use :view since it expects a controller. Should I make my own Spec::Rails::Example::ViewExampleGroup class? TIA.

---

## [Testing item links in Cucumber](https://www.ruby-forum.com/t/testing-item-links-in-cucumber/151850)

<div class="topic-metadata">

**Author:** [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Replies:** 0\
**Last updated:** [October 26, 2008, 11:33pm UTC](https://www.ruby-forum.com/t/testing-item-links-in-cucumber/151850 "2008-10-26T23:33:05Z")

</div>

I have an index template that contains a tabulated list of database items, each of which has an associated “display” link that enables the item to be displayed via a “show” action. In Cucumber I know how to test that …

---

## [Daylight savings time difference with rspec?](https://www.ruby-forum.com/t/daylight-savings-time-difference-with-rspec/151845)

<div class="topic-metadata">

**Author:** [@hrbishop](https://www.ruby-forum.com/u/hrbishop)\
**Replies:** 0\
**Last updated:** [October 26, 2008, 10:45pm UTC](https://www.ruby-forum.com/t/daylight-savings-time-difference-with-rspec/151845 "2008-10-26T22:45:34Z")

</div>

Hi all, I wanted to check this with you. I have an rspec example that checks the correct expiration date set on an object. The expiration is set in the model with expires\_on = Time.now + next\_duration\[phase\] where…

---

## [Cucumber hoe dependency](https://www.ruby-forum.com/t/cucumber-hoe-dependency/151775)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 5\
**Last updated:** [October 25, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/cucumber-hoe-dependency/151775 "2008-10-25T20:55:06Z")

</div>

Hi Am I right thinking that Cucumber needs hoe, but it’s not an explicit gem dependency? If so, how come? Thanks Ashley – http://www.patchspace.co.uk/

---

## [Using config.gem to freeze rspec (not #577)](https://www.ruby-forum.com/t/using-config-gem-to-freeze-rspec-not-577/151752)

<div class="topic-metadata">

**Author:** [@jacobhenry](https://www.ruby-forum.com/u/jacobhenry)\
**Replies:** 1\
**Last updated:** [October 25, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/using-config-gem-to-freeze-rspec-not-577/151752 "2008-10-25T15:34:08Z")

</div>

We have a project running on edge rails that has rspec and rspec-rails 1.1.9 frozen in vendor/gems. To freeze the gems we added two lines of code to environment.rb: config.gem ‘rspec-rails’, :lib =\> ‘spec/rails’, :v…

---

## [RSpec a DSL](https://www.ruby-forum.com/t/rspec-a-dsl/151762)

<div class="topic-metadata">

**Author:** [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Replies:** 1\
**Last updated:** [October 25, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/rspec-a-dsl/151762 "2008-10-25T15:17:43Z")

</div>

Hello G.s, I’m creating a small DSL that simplifies the creation of Rake tasks to handle multiple packages and their dependencies. (sorry David, tried Thor, do not do what I need). The thing is that basically I have …

---

## [Can't seem to test redirect?](https://www.ruby-forum.com/t/cant-seem-to-test-redirect/151714)

<div class="topic-metadata">

**Author:** [@hrbishop](https://www.ruby-forum.com/u/hrbishop)\
**Replies:** 8\
**Last updated:** [October 24, 2008, 11:34pm UTC](https://www.ruby-forum.com/t/cant-seem-to-test-redirect/151714 "2008-10-24T23:34:15Z")

</div>

I’m posting to the create action and seeing the line "at the motion save part of create in the following: def create @motion = Motion.new(params\[:motion\]) respond\_to do |format| if @motion.save puts “at the motion …

---

## [How to Spec a Module to be used in a Controller](https://www.ruby-forum.com/t/how-to-spec-a-module-to-be-used-in-a-controller/151606)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 4\
**Last updated:** [October 24, 2008, 9:55am UTC](https://www.ruby-forum.com/t/how-to-spec-a-module-to-be-used-in-a-controller/151606 "2008-10-24T09:55:29Z")

</div>

I want to be able to factor out bits of a controller’s behaviour into modules, and spec them independently. E.g. modules like Authentication and ExceptionHandling that are mixed into ApplicationController. In my spec,…

---

## [Specing protected methods](https://www.ruby-forum.com/t/specing-protected-methods/151596)

<div class="topic-metadata">

**Author:** [@bastien-vaucher](https://www.ruby-forum.com/u/bastien-vaucher)\
**Replies:** 14\
**Last updated:** [October 24, 2008, 7:58am UTC](https://www.ruby-forum.com/t/specing-protected-methods/151596 "2008-10-24T07:58:53Z")

</div>

Hi everyone, Do anyone know if there’s a way to spec protected methods ? Thanks in advance – Bastien

---

## [Surprising mock behavior](https://www.ruby-forum.com/t/surprising-mock-behavior/151186)

<div class="topic-metadata">

**Author:** [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Replies:** 15\
**Last updated:** [October 24, 2008, 6:16am UTC](https://www.ruby-forum.com/t/surprising-mock-behavior/151186 "2008-10-24T06:16:32Z")

</div>

I’m writing my first controller spec - for a controller that already exists, and in the process have observed some behavior I find a little surprising. I’d like to know whether I’m interpreting the situation correctly…

---

## [RSpec 1.1.9 on JRuby](https://www.ruby-forum.com/t/rspec-1-1-9-on-jruby/151615)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [October 23, 2008, 10:43pm UTC](https://www.ruby-forum.com/t/rspec-1-1-9-on-jruby/151615 "2008-10-23T22:43:47Z")

</div>

Hi Can you use RSpec 1.1.9 on JRuby? Now it depends on spicycode-rcov, I can’t install it: jgem install rspec --development Building native extensions. This could take a while… ERROR: Error installing rspec: ERR…

---

## [RSpec vs Screw.Unit](https://www.ruby-forum.com/t/rspec-vs-screw-unit/151109)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 17\
**Last updated:** [October 22, 2008, 5:39pm UTC](https://www.ruby-forum.com/t/rspec-vs-screw-unit/151109 "2008-10-22T17:39:30Z")

</div>

Hi Hope this isn’t OT. I’m currently contemplating using the Dojo\[1\] JavaScript framework, and I suspect it’s powerful enough that using Cucumber features and Celerity alone will quickly leave me wanting lower-level…

---

## [Where is current\_user?](https://www.ruby-forum.com/t/where-is-current-user/151307)

<div class="topic-metadata">

**Author:** [@hrbishop](https://www.ruby-forum.com/u/hrbishop)\
**Replies:** 22\
**Last updated:** [October 22, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/where-is-current-user/151307 "2008-10-22T17:24:47Z")

</div>

Hi, I have a controller that uses the current\_user attributes to determine if a motion is showable. I can see the motion track through from a fixture to the show action, but not the current\_user. My rspec test is d…

---

## [Re: config.gem/rspec-rails/rspec bug (#577)](https://www.ruby-forum.com/t/re-config-gem-rspec-rails-rspec-bug-577/151460)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 3\
**Last updated:** [October 22, 2008, 12:27pm UTC](https://www.ruby-forum.com/t/re-config-gem-rspec-rails-rspec-bug-577/151460 "2008-10-22T12:27:21Z")

</div>

Hey all, Just a heads up about a bug related to configuring the rspec gems in your rails 2.1.1 projects: Lighthouse - Beautifully Simple Issue Tracking Apparently, if you config.gem both rspec and rspec-rails 1.1.9 w…

---

## ['uninitialized constant Dispatcher' when calling rake features](https://www.ruby-forum.com/t/uninitialized-constant-dispatcher-when-calling-rake-features/151509)

<div class="topic-metadata">

**Author:** [@thbar](https://www.ruby-forum.com/u/thbar)\
**Replies:** 0\
**Last updated:** [October 22, 2008, 9:42am UTC](https://www.ruby-forum.com/t/uninitialized-constant-dispatcher-when-calling-rake-features/151509 "2008-10-22T09:42:52Z")

</div>

Hi, I’m facing an issue with cucumber: when calling ‘rake features’ I get an uninitialized constant Dispatcher (full stacktrace here: http://pastie.org/297842). I’m using Rails 2.0.5, the latest webrat/cucumber/rspec…

---

## [Cucumber, more examples, tabular data input sets](https://www.ruby-forum.com/t/cucumber-more-examples-tabular-data-input-sets/151244)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 12\
**Last updated:** [October 22, 2008, 9:12am UTC](https://www.ruby-forum.com/t/cucumber-more-examples-tabular-data-input-sets/151244 "2008-10-22T09:12:24Z")

</div>

Writing feature inputs in the tabular format has recently been very helpful. However, there are some things that seem kind of funny when writing. For example, let’s say we wanted to ensure that certain requests result…

---

## [Mocks: expectations vs spying](https://www.ruby-forum.com/t/mocks-expectations-vs-spying/151110)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 10\
**Last updated:** [October 21, 2008, 6:02pm UTC](https://www.ruby-forum.com/t/mocks-expectations-vs-spying/151110 "2008-10-21T18:02:20Z")

</div>

Hi again Ok, so I’m having a little research fling with JavaScript, and I’ve uncovered something I hadn’t seen before: “spying”. Basically, inspecting mocks after-the-fact, rather than setting expectations upfront. …

---

## [Merb](https://www.ruby-forum.com/t/merb/151291)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 11\
**Last updated:** [October 20, 2008, 10:25pm UTC](https://www.ruby-forum.com/t/merb/151291 "2008-10-20T22:25:03Z")

</div>

Hi Two questions: Anyone using Merb here, and writing specs for it? (I’ve just started tonight, so I’m figuring stuff out as I go along.) And WDYAT of their spec extensions\[1\]? Specifically their “given” given “a …

---

## [? lots of Q's about integration tests with rspec](https://www.ruby-forum.com/t/lots-of-qs-about-integration-tests-with-rspec/151368)

<div class="topic-metadata">

**Author:** [@crumb](https://www.ruby-forum.com/u/crumb)\
**Replies:** 2\
**Last updated:** [October 20, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/lots-of-qs-about-integration-tests-with-rspec/151368 "2008-10-20T19:28:48Z")

</div>

Hello all, where should I put the integration tests when using rspec? There is an integration-folder in test-directory, but if I place tests here then how can I benefit from the fixtures-dir in spec-folder? I want to…

---

## [RSpec-Rails bug with to\_xml?](https://www.ruby-forum.com/t/rspec-rails-bug-with-to-xml/151330)

<div class="topic-metadata">

**Author:** [@Bira](https://www.ruby-forum.com/u/Bira)\
**Replies:** 5\
**Last updated:** [October 20, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/rspec-rails-bug-with-to-xml/151330 "2008-10-20T17:28:53Z")

</div>

Hello, everyone. I’ve been lurking here for a while, but this is my first post. I think I’ve run into a RSpec bug in a Rails project I’m working on. I was working on a few REST controllers, and started getting failure…

---

## [Error loading Rails fixtures](https://www.ruby-forum.com/t/error-loading-rails-fixtures/151248)

<div class="topic-metadata">

**Author:** [@scottbrisko](https://www.ruby-forum.com/u/scottbrisko)\
**Replies:** 1\
**Last updated:** [October 20, 2008, 2:38pm UTC](https://www.ruby-forum.com/t/error-loading-rails-fixtures/151248 "2008-10-20T14:38:53Z")

</div>

Hi all; I’m getting a weird error from the rspec gem when using rake to load fixtures in rails: % rake db:fixtures:load RAILS\_ENV=test /path/to/Ruby/Gems/1.8/gems/rspec-1.1.8/lib/spec/runner/options.rb: 229:in files…

---

## [How should i use response.should be sucess method pass](https://www.ruby-forum.com/t/how-should-i-use-response-should-be-sucess-method-pass/151310)

<div class="topic-metadata">

**Author:** [@manoah](https://www.ruby-forum.com/u/manoah)\
**Replies:** 1\
**Last updated:** [October 20, 2008, 9:24am UTC](https://www.ruby-forum.com/t/how-should-i-use-response-should-be-sucess-method-pass/151310 "2008-10-20T09:24:30Z")

</div>

I want to test the basic controller test action and to make response.should be\_sucess method work for it. How can i do

---

## [Test HTML output from Rails helper](https://www.ruby-forum.com/t/test-html-output-from-rails-helper/151218)

<div class="topic-metadata">

**Author:** [@Thomas\_WSSteen](https://www.ruby-forum.com/u/Thomas_WSSteen)\
**Replies:** 8\
**Last updated:** [October 19, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/test-html-output-from-rails-helper/151218 "2008-10-19T18:12:15Z")

</div>

Hi I’m using RSpec in with Ruby on Rails. I’ve made a helper module method that generates some HTML and would like to create a rspec test to validate this HTML. I can of cause use regex to validate it as a string, bu…

---

## [Why @controller is nil error on loading fixtures in model?](https://www.ruby-forum.com/t/why-controller-is-nil-error-on-loading-fixtures-in-model/151262)

<div class="topic-metadata">

**Author:** [@hrbishop](https://www.ruby-forum.com/u/hrbishop)\
**Replies:** 2\
**Last updated:** [October 19, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/why-controller-is-nil-error-on-loading-fixtures-in-model/151262 "2008-10-19T16:12:00Z")

</div>

Hi, I’m new to rspec and working on catching up my app with rspec testing. I’m running OSX 10.5.5 with Rails 2.1.0 and Rspec 1.1.8. Most things I’ve tried work except loading fixtures. I setup a describe block for t…

---

## [Running Cucumber with a Rails Rake task](https://www.ruby-forum.com/t/running-cucumber-with-a-rails-rake-task/151255)

<div class="topic-metadata">

**Author:** [@benemson](https://www.ruby-forum.com/u/benemson)\
**Replies:** 3\
**Last updated:** [October 19, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/running-cucumber-with-a-rails-rake-task/151255 "2008-10-19T15:36:08Z")

</div>

Hi All I’ve just started experimenting with Cucumber and its great. However I wasn’t quite sure how I should integrate it into my Rails application. What I would like to do is set my Rails app up so that I can run a …

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

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