# RSpec

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

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

---

## [Indentation Conventions for Ruby and Cucumber](https://www.ruby-forum.com/t/indentation-conventions-for-ruby-and-cucumber/154737)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 8\
**Last updated:** [December 8, 2008, 9:32pm UTC](https://www.ruby-forum.com/t/indentation-conventions-for-ruby-and-cucumber/154737 "2008-12-08T21:32:08Z")

</div>

On Thu, Nov 27, 2008 at 4:28 PM, Aslak HellesÃ¸y removed\_email\_address@domain.invalidwrote: When (if) this thread ends, let’s start a discussion about indentation conventions! Oh… let the pleasure be mine!.. and wh…

---

## [Uber-rcov for both cucumber & rspec](https://www.ruby-forum.com/t/uber-rcov-for-both-cucumber-rspec/155150)

<div class="topic-metadata">

**Author:** [@rupert](https://www.ruby-forum.com/u/rupert)\
**Replies:** 1\
**Last updated:** [December 8, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/uber-rcov-for-both-cucumber-rspec/155150 "2008-12-08T20:11:18Z")

</div>

I’ve had a quick look at the rake tasks for rspec and cucumber (and rcov), but not having payed with rake very much I can’t at the moment get my head around what I need to do so am hoping for some guidance… What I wa…

---

## [View tests and fragment caching issue](https://www.ruby-forum.com/t/view-tests-and-fragment-caching-issue/154982)

<div class="topic-metadata">

**Author:** [@fxp](https://www.ruby-forum.com/u/fxp)\
**Replies:** 1\
**Last updated:** [December 7, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/view-tests-and-fragment-caching-issue/154982 "2008-12-07T22:29:12Z")

</div>

I hope I’m just missing something obvious here, but I am using fragment caching in a partial for a view. I test this view with an RSpec view test. The particular test is using “real” data (i.e. not mocked objects, e…

---

## [Database.truncate\_all](https://www.ruby-forum.com/t/database-truncate-all/155011)

<div class="topic-metadata">

**Author:** [@reversejt](https://www.ruby-forum.com/u/reversejt)\
**Replies:** 9\
**Last updated:** [December 7, 2008, 8:21pm UTC](https://www.ruby-forum.com/t/database-truncate-all/155011 "2008-12-07T20:21:09Z")

</div>

There is a seemingly very useful line of code in the cucumber wiki that I’d like to use: After do # Scenario teardown Database.truncate\_all end (from http://github.com/aslakhellesoy/cucumber/wikis/migration-from-r…

---

## ['And' step definition](https://www.ruby-forum.com/t/and-step-definition/155005)

<div class="topic-metadata">

**Author:** [@marksbrain](https://www.ruby-forum.com/u/marksbrain)\
**Replies:** 4\
**Last updated:** [December 6, 2008, 11:10pm UTC](https://www.ruby-forum.com/t/and-step-definition/155005 "2008-12-06T23:10:14Z")

</div>

Can you have an And step in a feature? With this, I get a NoMethodError for ‘And’: Given /a company named (.+)/ do |name| @company = Company.create!(:name =\> name) end And /a user named (.+)/ do |name| @user = cre…

---

## [Update RSpec but have a problem!](https://www.ruby-forum.com/t/update-rspec-but-have-a-problem/155034)

<div class="topic-metadata">

**Author:** [@capi](https://www.ruby-forum.com/u/capi)\
**Replies:** 2\
**Last updated:** [December 6, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/update-rspec-but-have-a-problem/155034 "2008-12-06T22:59:32Z")

</div>

Hi people! I run rake spec \*\* Invoke spec (first\_time, not\_needed) and specs not started! What that’s mean? Thanks!

---

## [Cucumber and autotest - running all features?](https://www.ruby-forum.com/t/cucumber-and-autotest-running-all-features/154331)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 9\
**Last updated:** [December 6, 2008, 8:18pm UTC](https://www.ruby-forum.com/t/cucumber-and-autotest-running-all-features/154331 "2008-12-06T20:18:21Z")

</div>

Given I have cucumber (0.1.10) And I have ZenTest (3.11.0) And I have features in sub-directories under a directory called features And Each feature sub-directory has a sub-directory called step\_definitions And I h…

---

## [RSpec and 1.9 Compatibility](https://www.ruby-forum.com/t/rspec-and-1-9-compatibility/155025)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 1\
**Last updated:** [December 6, 2008, 5:33pm UTC](https://www.ruby-forum.com/t/rspec-and-1-9-compatibility/155025 "2008-12-06T17:33:37Z")

</div>

OK… I am making a mail library that is taking advantage of the new things in 1.9, mainly encoding and the new regex goodness. However, RSpec is not jiggy with it right now on 1.9… so I’m going to try and scratch an …

---

## [Proxy associantion on controllers](https://www.ruby-forum.com/t/proxy-associantion-on-controllers/154949)

<div class="topic-metadata">

**Author:** [@Daniel\_Area\_CriaSSS](https://www.ruby-forum.com/u/Daniel_Area_CriaSSS)\
**Replies:** 10\
**Last updated:** [December 6, 2008, 2:58pm UTC](https://www.ruby-forum.com/t/proxy-associantion-on-controllers/154949 "2008-12-06T14:58:28Z")

</div>

Hello, I’m trying learn Rspec but having problems to understand when and how user mocks and stubs. I have a properties\_controller with to before\_filter actions (check\_administrator\_role e load\_user)… to access index …

---

## [Cucumber and autospec do not work?](https://www.ruby-forum.com/t/cucumber-and-autospec-do-not-work/155001)

<div class="topic-metadata">

**Author:** [@Kero\_van\_Gelder](https://www.ruby-forum.com/u/Kero_van_Gelder)\
**Replies:** 3\
**Last updated:** [December 6, 2008, 12:14pm UTC](https://www.ruby-forum.com/t/cucumber-and-autospec-do-not-work/155001 "2008-12-06T12:14:18Z")

</div>

Hi! I’m not sure this is how cucumber should behave. Should I file one or three tickets at http://rspec.lighthouseapp.com/projects/16211-cucumber ? $ cucumber -v 0.1.12 $ mkdir fresh $ cd fresh $ cucumber cucum…

---

## [MockExpectationError](https://www.ruby-forum.com/t/mockexpectationerror/155010)

<div class="topic-metadata">

**Author:** [@songrit](https://www.ruby-forum.com/u/songrit)\
**Replies:** 2\
**Last updated:** [December 6, 2008, 7:52am UTC](https://www.ruby-forum.com/t/mockexpectationerror/155010 "2008-12-06T07:52:50Z")

</div>

no matter how I try to stub! it still showing this error I have the following in my spec Profile.stub!(:new).and\_return(@profile = mock\_model(Profile)) Then (rdb:1) @profile.stub!(:user) #\<Spec::Mocks::MessageExpect…

---

## [Problem to mock association proxy](https://www.ruby-forum.com/t/problem-to-mock-association-proxy/154952)

<div class="topic-metadata">

**Author:** [@liberte](https://www.ruby-forum.com/u/liberte)\
**Replies:** 4\
**Last updated:** [December 5, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/problem-to-mock-association-proxy/154952 "2008-12-05T21:43:42Z")

</div>

Hello, I’m trying learn Rspec but having problems to understand when and how user mocks and stubs. I have a properties\_controller with to before\_filter actions (check\_administrator\_role e load\_user)… to access index …

---

## [NameError when passing a URL helper to a method](https://www.ruby-forum.com/t/nameerror-when-passing-a-url-helper-to-a-method/154892)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 7\
**Last updated:** [December 5, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/nameerror-when-passing-a-url-helper-to-a-method/154892 "2008-12-05T19:06:37Z")

</div>

Hi guys. I just wrote a small spec helper method to DRY up some of my specs, and found that passing a URL helper (Eg: #photos\_url) to a method results in a NameError error. I extracted the problem into its own short s…

---

## [Rails project as a template for other projects (off topic)](https://www.ruby-forum.com/t/rails-project-as-a-template-for-other-projects-off-topic/154879)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 8\
**Last updated:** [December 5, 2008, 5:48pm UTC](https://www.ruby-forum.com/t/rails-project-as-a-template-for-other-projects-off-topic/154879 "2008-12-05T17:48:04Z")

</div>

This is of topic but I have a feeling I might get some useful advice here - hope you don’t mind I’ve created a rails project that I want to use as a basis for other rails project. I was wondering if anyone had any t…

---

## [I met a trouble: cannot do a form post to an outside website](https://www.ruby-forum.com/t/i-met-a-trouble-cannot-do-a-form-post-to-an-outside-website/154733)

<div class="topic-metadata">

**Author:** [@rubbit](https://www.ruby-forum.com/u/rubbit)\
**Replies:** 1\
**Last updated:** [December 5, 2008, 8:57am UTC](https://www.ruby-forum.com/t/i-met-a-trouble-cannot-do-a-form-post-to-an-outside-website/154733 "2008-12-05T08:57:35Z")

</div>

now i use webrat for cucumber scenario testing. i have a page with a form, which will post to a bank payment gateway. that is, ... my scenario step script is: == And I press “confirm” then I got such an err…

---

## [Restful-Authentication features rewrite](https://www.ruby-forum.com/t/restful-authentication-features-rewrite/154921)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 1\
**Last updated:** [December 5, 2008, 7:44am UTC](https://www.ruby-forum.com/t/restful-authentication-features-rewrite/154921 "2008-12-05T07:44:17Z")

</div>

I’ve put up a Rails sample project on github whose main feature is a rewrite of the restful-authentication stories using features and trying to exhibit good practice. I’d love to get some feedback from the group abou…

---

## [Using Cucumber with latest Webrat](https://www.ruby-forum.com/t/using-cucumber-with-latest-webrat/154649)

<div class="topic-metadata">

**Author:** [@srveit](https://www.ruby-forum.com/u/srveit)\
**Replies:** 4\
**Last updated:** [December 4, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/using-cucumber-with-latest-webrat/154649 "2008-12-04T22:34:59Z")

</div>

I added cucumber to my rails project using the following commands: git submodule add git://github.com/aslakhellesoy/cucumber.git vendor/plugins/cucumber ruby script/generate cucumber git submodule add git://github.c…

---

## [Class \<\< self considered harmful... really?](https://www.ruby-forum.com/t/class-self-considered-harmful-really/154110)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 59\
**Last updated:** [December 4, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/class-self-considered-harmful-really/154110 "2008-12-04T20:20:55Z")

</div>

Sorry, I know this is off-topic, but I’d really like to know what the revered ruby-hackers who read this list think. See http://ozmm.org/posts/class\_\_self\_is\_harmful.html I have adopted class \<\< self, partly from rea…

---

## [Any plans for Before-feature or Before-all steps in Cucumber?](https://www.ruby-forum.com/t/any-plans-for-before-feature-or-before-all-steps-in-cucumber/154643)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 11\
**Last updated:** [December 4, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/any-plans-for-before-feature-or-before-all-steps-in-cucumber/154643 "2008-12-04T19:11:00Z")

</div>

Hi The code I’m working on now is a server daemon that talks to Twitter, an RSS feed, and some web pages. I’ve got mock implementations of Twitter and the web stuff, which I start and stop with daemon\_controller\[1\].…

---

## [The RSpec way of doing this? Need help on validating block](https://www.ruby-forum.com/t/the-rspec-way-of-doing-this-need-help-on-validating-block/154829)

<div class="topic-metadata">

**Author:** [@hoshbad](https://www.ruby-forum.com/u/hoshbad)\
**Replies:** 3\
**Last updated:** [December 4, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/the-rspec-way-of-doing-this-need-help-on-validating-block/154829 "2008-12-04T18:53:19Z")

</div>

Hello, I’m back again with more questions about mocks and how to do good testing in general. Let’s say I’m writing this EmailSender class and I want to make it totally awesomely tested with RSpec. Here’s how far I’ve …

---

## [Cucumber on IronRuby](https://www.ruby-forum.com/t/cucumber-on-ironruby/154840)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 0\
**Last updated:** [December 4, 2008, 11:25am UTC](https://www.ruby-forum.com/t/cucumber-on-ironruby/154840 "2008-12-04T11:25:09Z")

</div>

I just released Cucumber 0.1.12 which has support and examples for IronRuby (Ruby on .NET). http://github.com/aslakhellesoy/cucumber/tree/v0.1.12/History.txt It’s early days, so if there are any .NET folks out here …

---

## [Cucumber and Rcov](https://www.ruby-forum.com/t/cucumber-and-rcov/154806)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [December 4, 2008, 4:42am UTC](https://www.ruby-forum.com/t/cucumber-and-rcov/154806 "2008-12-04T04:42:27Z")

</div>

I am now trying to get rcov to work for me, without much success. I stole the rake task code from the cucumber site: desc “Run all features” task :features =\> “features:all” task :features =\> ‘db:test:prepare’ requ…

---

## [Intermittent Cucumber exception](https://www.ruby-forum.com/t/intermittent-cucumber-exception/154755)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 3\
**Last updated:** [December 3, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/intermittent-cucumber-exception/154755 "2008-12-03T20:03:00Z")

</div>

Hi Anyone recognise this exception, and know what causes it to happen occasionally? Thanks Ashley Scenario: new story appears on feed # features/descriptions/ story\_notification.f…

---

## [Running Rspec from ruby code](https://www.ruby-forum.com/t/running-rspec-from-ruby-code/154723)

<div class="topic-metadata">

**Author:** [@Attila\_JuhSSSSsz](https://www.ruby-forum.com/u/Attila_JuhSSSSsz)\
**Replies:** 0\
**Last updated:** [December 3, 2008, 9:59am UTC](https://www.ruby-forum.com/t/running-rspec-from-ruby-code/154723 "2008-12-03T09:59:32Z")

</div>

Hi everyone! First of all I am quite new at the rspec world. I have an idea, but I can’t make it work. I would like to run one rspec spec file from a ruby daemon, and get the result back into a string. Is it possibl…

---

## [Musical Cucumber](https://www.ruby-forum.com/t/musical-cucumber/154585)

<div class="topic-metadata">

**Author:** [@joesniff](https://www.ruby-forum.com/u/joesniff)\
**Replies:** 3\
**Last updated:** [December 3, 2008, 6:45am UTC](https://www.ruby-forum.com/t/musical-cucumber/154585 "2008-12-03T06:45:12Z")

</div>

Sorry, I had to share that :slight\_smile: Joseph W.

---

## [Sample App - TDD with Cucumber and RSpec](https://www.ruby-forum.com/t/sample-app-tdd-with-cucumber-and-rspec/154554)

<div class="topic-metadata">

**Author:** [@phylae](https://www.ruby-forum.com/u/phylae)\
**Replies:** 8\
**Last updated:** [December 2, 2008, 10:13pm UTC](https://www.ruby-forum.com/t/sample-app-tdd-with-cucumber-and-rspec/154554 "2008-12-02T22:13:41Z")

</div>

Hi, I just posted a tiny app that I put together for a presentation on Cucumber. This essentially mirrors the workflow that I strive towards. (The README explains more.) I don’t want to put myself out there as the s…

---

## [Cucumber/rspec pending call](https://www.ruby-forum.com/t/cucumber-rspec-pending-call/154662)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 4\
**Last updated:** [December 2, 2008, 8:47pm UTC](https://www.ruby-forum.com/t/cucumber-rspec-pending-call/154662 "2008-12-02T20:47:49Z")

</div>

I have tried to do this in a step definition: When /set the “(.)" to "(.)”/ do |a,v| pending end However, no matter how I invoke cucumber, I get this error: And I set the "type" to "main" # f…

---

## [Setup for autospec for non-rails project](https://www.ruby-forum.com/t/setup-for-autospec-for-non-rails-project/154656)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 4\
**Last updated:** [December 2, 2008, 7:30pm UTC](https://www.ruby-forum.com/t/setup-for-autospec-for-non-rails-project/154656 "2008-12-02T19:30:57Z")

</div>

I brought this up some time ago. I’m trying to use autotest to run specs in a non-rails project. FWIW the project is structured using the bones gem. $ spec -v rspec 1.1.11 k$ gem list zentest \*\*\* LOCAL GEMS \*\*\* Ze…

---

## [Using Rspec for web tests](https://www.ruby-forum.com/t/using-rspec-for-web-tests/154651)

<div class="topic-metadata">

**Author:** [@Peter\_Nicolai\_Motzf](https://www.ruby-forum.com/u/Peter_Nicolai_Motzf)\
**Replies:** 1\
**Last updated:** [December 2, 2008, 5:19pm UTC](https://www.ruby-forum.com/t/using-rspec-for-web-tests/154651 "2008-12-02T17:19:07Z")

</div>

Hi, I am trying to use Rspec together with FunFX for Flex testing. To ease the number of tests and the functionality each test does, I would like to run all the it “shoulds…” in sequence. This works just fine, but t…

---

## [Variance in behaviour: rake features vs. autotest](https://www.ruby-forum.com/t/variance-in-behaviour-rake-features-vs-autotest/154255)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 22\
**Last updated:** [December 1, 2008, 6:11pm UTC](https://www.ruby-forum.com/t/variance-in-behaviour-rake-features-vs-autotest/154255 "2008-12-01T18:11:32Z")

</div>

$ rake features … 56 steps passed $ set AUTOFEATURE=true BASH=/bin/bash … $ autotest … script/cucumber features --format progress --format autotest --out /tmp/autotest-cucumber.1527.0 FFF\_\_\_\_F\_\_F\_\_F\_\_F\_\_F\_P\_F\_…

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

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