# RSpec

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

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

---

## [Conditionally turning some specs on and off depending on runtime platform](https://www.ruby-forum.com/t/conditionally-turning-some-specs-on-and-off-depending-on-runtime-platform/149539)

<div class="topic-metadata">

**Author:** [@Wincent\_C](https://www.ruby-forum.com/u/Wincent_C)\
**Replies:** 9\
**Last updated:** [September 27, 2008, 9:41am UTC](https://www.ruby-forum.com/t/conditionally-turning-some-specs-on-and-off-depending-on-runtime-platform/149539 "2008-09-27T09:41:36Z")

</div>

Hi folks, Wondering what the best (that is, neatest and most supported) way to conditionally turn off some specs depending on the runtime platform. Background: some of my specs call out to some third-party tools that …

---

## [DRY up story](https://www.ruby-forum.com/t/dry-up-story/141339)

<div class="topic-metadata">

**Author:** [@hayafirst](https://www.ruby-forum.com/u/hayafirst)\
**Replies:** 9\
**Last updated:** [September 27, 2008, 2:42am UTC](https://www.ruby-forum.com/t/dry-up-story/141339 "2008-09-27T02:42:49Z")

</div>

In David’s presentation @ RailsConf, he has this example: Story: measure progress towards registration goals As a conference organizer I want to see a report of registrations So that I can measure progress towards re…

---

## [RSpec, Rails, ObjectDaddy and transactions](https://www.ruby-forum.com/t/rspec-rails-objectdaddy-and-transactions/149609)

<div class="topic-metadata">

**Author:** [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Replies:** 4\
**Last updated:** [September 26, 2008, 8:43pm UTC](https://www.ruby-forum.com/t/rspec-rails-objectdaddy-and-transactions/149609 "2008-09-26T20:43:21Z")

</div>

hey all, I’ve started playing around with object daddy and have a question? How do I ensure that anything created during a spec example gets rolled back before the next one? Without that ability, it starts messing wi…

---

## [Language configuration in cucumber](https://www.ruby-forum.com/t/language-configuration-in-cucumber/149574)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 4\
**Last updated:** [September 26, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/language-configuration-in-cucumber/149574 "2008-09-26T18:06:06Z")

</div>

I have just installed cucumber in a rails application following the instructions in the wiki How I have to specify the configuration option for using cucumber in spanish language? Is there a file cucumber.opts in so…

---

## [BDD / cucumber thought - chaining 'Then' steps with Which](https://www.ruby-forum.com/t/bdd-cucumber-thought-chaining-then-steps-with-which/149576)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 6\
**Last updated:** [September 26, 2008, 5:05pm UTC](https://www.ruby-forum.com/t/bdd-cucumber-thought-chaining-then-steps-with-which/149576 "2008-09-26T17:05:58Z")

</div>

Going back to the debate about keeping state between steps, I found myself with the mild urge to be able to write this today: Given there is a user And the user has 20 friends Then I should see a thumbnail of each of…

---

## [\#stub! and #should\_receive on the same method](https://www.ruby-forum.com/t/stub-and-should-receive-on-the-same-method/149524)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 7\
**Last updated:** [September 25, 2008, 9:16pm UTC](https://www.ruby-forum.com/t/stub-and-should-receive-on-the-same-method/149524 "2008-09-25T21:16:04Z")

</div>

I’m calling #stub! and #should\_receive on the same method within a class, and am finding that the method doesn’t return the value given to #stub! 216 it ‘should make a map marker’ do 217 mock\_property = moc…

---

## [How to define request.domain in when testing](https://www.ruby-forum.com/t/how-to-define-request-domain-in-when-testing/149387)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 19\
**Last updated:** [September 25, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/how-to-define-request-domain-in-when-testing/149387 "2008-09-25T20:58:36Z")

</div>

Hi, My application relies on request.domain for doing its job. The problem I am encountering, is that when running tests, request.domain returns “test.host”, how can I change that so that it returns “mysite.com”? Tha…

---

## [Should raise\_error](https://www.ruby-forum.com/t/should-raise-error/149519)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 5\
**Last updated:** [September 25, 2008, 7:34pm UTC](https://www.ruby-forum.com/t/should-raise-error/149519 "2008-09-25T19:34:12Z")

</div>

I noticed in the RSpec documentation that “object.should raise\_error” isn’t enclosed in a begin…rescue…end : http://rspec.info/rdoc/classes/Spec/Matchers.html#M000420 However, when I use #raise\_error , I have to rescu…

---

## [TextMate and RSpec](https://www.ruby-forum.com/t/textmate-and-rspec/149418)

<div class="topic-metadata">

**Author:** [@msojka](https://www.ruby-forum.com/u/msojka)\
**Replies:** 1\
**Last updated:** [September 25, 2008, 12:23am UTC](https://www.ruby-forum.com/t/textmate-and-rspec/149418 "2008-09-25T00:23:35Z")

</div>

I have to persist some data in the database to test the interactions between two of my models. One model has a serial number attribute that is unique, so it must be entered once and only once. rake spec deletes all th…

---

## [Rspec runs tests when not appropriate](https://www.ruby-forum.com/t/rspec-runs-tests-when-not-appropriate/149423)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 2\
**Last updated:** [September 24, 2008, 9:26pm UTC](https://www.ruby-forum.com/t/rspec-runs-tests-when-not-appropriate/149423 "2008-09-24T21:26:12Z")

</div>

Hi, I have found 2 troubles with rspec, it is currently running the test suites in the following cases which is highly annoying: when I only edit comments in the files. when I commit changes to my mercurial repos…

---

## [Cucumber comments?](https://www.ruby-forum.com/t/cucumber-comments/149422)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 1\
**Last updated:** [September 24, 2008, 6:32pm UTC](https://www.ruby-forum.com/t/cucumber-comments/149422 "2008-09-24T18:32:11Z")

</div>

Hi, In the Story Runner I was using hashes as comments. However, I am getting a parse error when using cucumber. What do others do? Aidy

---

## [Upgraded to 2.1 and 1.1.4 from 2.0 and 1.1.3, no output from 'rake spec'](https://www.ruby-forum.com/t/upgraded-to-2-1-and-1-1-4-from-2-0-and-1-1-3-no-output-from-rake-spec/146654)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 6\
**Last updated:** [September 24, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/upgraded-to-2-1-and-1-1-4-from-2-0-and-1-1-3-no-output-from-rake-spec/146654 "2008-09-24T14:48:50Z")

</div>

$ rake spec --trace (in /Users/joe/projects/tanga) \*\* Invoke spec (first\_time) \*\* Invoke db:test:prepare (first\_time) \*\* Invoke db:abort\_if\_pending\_migrations (first\_time) \*\* Invoke environment (first\_time) \*\* Exec…

---

## [Separating black sheep examples from the rest](https://www.ruby-forum.com/t/separating-black-sheep-examples-from-the-rest/149324)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 7\
**Last updated:** [September 24, 2008, 12:27pm UTC](https://www.ruby-forum.com/t/separating-black-sheep-examples-from-the-rest/149324 "2008-09-24T12:27:42Z")

</div>

So we’ve got a pretty decent number of specs now, and despite my best efforts, AR is just forcing us down the path of having to use database interaction for some of the model specs. It’s starting to get tiring to run …

---

## [Cucumber: listing redundant step matchers](https://www.ruby-forum.com/t/cucumber-listing-redundant-step-matchers/149380)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 1\
**Last updated:** [September 24, 2008, 12:09pm UTC](https://www.ruby-forum.com/t/cucumber-listing-redundant-step-matchers/149380 "2008-09-24T12:09:28Z")

</div>

Is there any way currently to list out the step matchers that were never used when you run a set of features? This would help me keep our step files tidy. If not, some pointers to how I might write such a thing would …

---

## [Rspec and rspec-rails install hell](https://www.ruby-forum.com/t/rspec-and-rspec-rails-install-hell/140200)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 11\
**Last updated:** [September 24, 2008, 1:20am UTC](https://www.ruby-forum.com/t/rspec-and-rspec-rails-install-hell/140200 "2008-09-24T01:20:33Z")

</div>

I am attending a training course covering rspec. I am using a MS WinXPpro SP3 machine. I have installed the cygwin environment. I am using git 1.5.4. I am using ruby 1.8.6 (2007-09-24 patchlevel 111) \[i386-mswin32…

---

## [Story Runner =\> Cucumber(duplicate steps)!](https://www.ruby-forum.com/t/story-runner-cucumber-duplicate-steps/149329)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 2\
**Last updated:** [September 23, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/story-runner-cucumber-duplicate-steps/149329 "2008-09-23T18:47:32Z")

</div>

Hi, I am currently moving over my Watir Story Runner tests over to Cucumber. However, I have a verification\_steps.rb that holds these two steps Then “the user is at ‘$title’ page” do |title| browser.wait\_until\_includ…

---

## [Plans for cucumber](https://www.ruby-forum.com/t/plans-for-cucumber/149213)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 11\
**Last updated:** [September 23, 2008, 3:00pm UTC](https://www.ruby-forum.com/t/plans-for-cucumber/149213 "2008-09-23T15:00:39Z")

</div>

Hey all, Let’s make this official. We’re planning to replace the RSpec Story Runner with Cucumber. The rspec-1.1.5 release will still include the Story Runner (several fixes since the last release). So if you’re not …

---

## [\[newbie\]: How to test for operations inside a block?](https://www.ruby-forum.com/t/newbie-how-to-test-for-operations-inside-a-block/149226)

<div class="topic-metadata">

**Author:** [@carminem](https://www.ruby-forum.com/u/carminem)\
**Replies:** 11\
**Last updated:** [September 23, 2008, 9:36am UTC](https://www.ruby-forum.com/t/newbie-how-to-test-for-operations-inside-a-block/149226 "2008-09-23T09:36:00Z")

</div>

Hi to everyone, I’m just trying to wrap my mind around BDD and RSpec. I’ve gone through “The rails’ way” and RSpec webcasts series, and still don’t have a clear vision of RSpec. Is there anything else I could read/wat…

---

## [Including matchers in Cucumber](https://www.ruby-forum.com/t/including-matchers-in-cucumber/149198)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [September 22, 2008, 11:46pm UTC](https://www.ruby-forum.com/t/including-matchers-in-cucumber/149198 "2008-09-22T23:46:01Z")

</div>

Hi Where do you include matcher modules in Cucumber so they don’t pollute Object? ie so module TwitterMatchers class HaveUserStatus # … end def have\_user\_status(user, status) HaveUserStatus.new(user, status) …

---

## [Cucumber cli getting called incorrectly?](https://www.ruby-forum.com/t/cucumber-cli-getting-called-incorrectly/149243)

<div class="topic-metadata">

**Author:** [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Replies:** 1\
**Last updated:** [September 22, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/cucumber-cli-getting-called-incorrectly/149243 "2008-09-22T22:32:41Z")

</div>

I’m running Rails 2.1.1 and the newest cucumber gem/plugin as of this morning. When I run scripts like ruby script/generate or any (I think) rake task (I tried 4 or 5), I get the following timg-2:1-3-development tim…

---

## [Database clearing](https://www.ruby-forum.com/t/database-clearing/149030)

<div class="topic-metadata">

**Author:** [@tdd2110](https://www.ruby-forum.com/u/tdd2110)\
**Replies:** 22\
**Last updated:** [September 21, 2008, 8:52am UTC](https://www.ruby-forum.com/t/database-clearing/149030 "2008-09-21T08:52:39Z")

</div>

I’m seeing something strange and was just wondering if someone can confirm my assumptions for me: I have user model with a number of specs: some of them use fixtures and some of them don’t. Today, while talking som…

---

## [Workflow: user =\> stories/features =\> spec =\> code =\> user](https://www.ruby-forum.com/t/workflow-user-stories-features-spec-code-user/148992)

<div class="topic-metadata">

**Author:** [@DyingToLearn](https://www.ruby-forum.com/u/DyingToLearn)\
**Replies:** 6\
**Last updated:** [September 20, 2008, 1:01am UTC](https://www.ruby-forum.com/t/workflow-user-stories-features-spec-code-user/148992 "2008-09-20T01:01:12Z")

</div>

Hi, I am still trying to learn how to effectively use BDD. I would like to know if there is a typical BDD workflow or if it is really just a question of personal preference. So far I see the following steps being fai…

---

## [Help with webrat and selectors](https://www.ruby-forum.com/t/help-with-webrat-and-selectors/149053)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 1\
**Last updated:** [September 19, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/help-with-webrat-and-selectors/149053 "2008-09-19T21:41:22Z")

</div>

Hi, sorry if this isnt directly an rspec question but maybe someone can help lets say a page contains a list setup like this Item One Item Two Item Three in my story i want to refer to “first item”, “second…

---

## [Specing the Precedence of Rails Routes](https://www.ruby-forum.com/t/specing-the-precedence-of-rails-routes/149010)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 0\
**Last updated:** [September 19, 2008, 10:38am UTC](https://www.ruby-forum.com/t/specing-the-precedence-of-rails-routes/149010 "2008-09-19T10:38:56Z")

</div>

Sorry that this is only a tentatively RSpec-related question folks. I had a bug today which was caused by two routing resources being specified in a particular order: map.resources :comments map.resources :posts, :ha…

---

## [Making autotest run other specs](https://www.ruby-forum.com/t/making-autotest-run-other-specs/148950)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 5\
**Last updated:** [September 18, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/making-autotest-run-other-specs/148950 "2008-09-18T19:53:11Z")

</div>

hi there, I’ve been spec-ing classes in my lib/ directory, but until now only get spec to run using: script/spec spec/lib/ is there a way to make autotest load specs for this directory too? thanks in advance, joaq…

---

## [Help on skipping a before\_filter for a story](https://www.ruby-forum.com/t/help-on-skipping-a-before-filter-for-a-story/148085)

<div class="topic-metadata">

**Author:** [@Eric\_Harris-Braun](https://www.ruby-forum.com/u/Eric_Harris-Braun)\
**Replies:** 8\
**Last updated:** [September 18, 2008, 3:01pm UTC](https://www.ruby-forum.com/t/help-on-skipping-a-before-filter-for-a-story/148085 "2008-09-18T15:01:13Z")

</div>

Hi folks, I’m hoping for a bit of help on best-practices for skipping a before\_filter when running a particular step. Specifically the authentication filter. What happens is that the post (see code below) returns a…

---

## [Prepare for newbie-ness](https://www.ruby-forum.com/t/prepare-for-newbie-ness/148739)

<div class="topic-metadata">

**Author:** [@msojka](https://www.ruby-forum.com/u/msojka)\
**Replies:** 14\
**Last updated:** [September 18, 2008, 10:28am UTC](https://www.ruby-forum.com/t/prepare-for-newbie-ness/148739 "2008-09-18T10:28:10Z")

</div>

A few questions from someone new to rspec. 1/ I have several complex yet largely independent models using rspec to test internals and computation methods. I am about to tackle models that have several ties to each oth…

---

## [Should\_receive working in before(:each) but not in example](https://www.ruby-forum.com/t/should-receive-working-in-before-each-but-not-in-example/148903)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 2\
**Last updated:** [September 18, 2008, 5:46am UTC](https://www.ruby-forum.com/t/should-receive-working-in-before-each-but-not-in-example/148903 "2008-09-18T05:46:57Z")

</div>

Hi there, I’m striking a wee problem - and haven’t been able to figure it out. In my before statement I’m setting up a mock video. I’d like one of my examples to check that original= and save! are being called on …

---

## [Cucumber - mark a step as pending](https://www.ruby-forum.com/t/cucumber-mark-a-step-as-pending/148142)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 12\
**Last updated:** [September 18, 2008, 5:39am UTC](https://www.ruby-forum.com/t/cucumber-mark-a-step-as-pending/148142 "2008-09-18T05:39:21Z")

</div>

I love the way I can throw a call to pending() in the top of an unfinished RSpec example and stop it from failing the build. Is there a similar way to do such a thing with good ole’ cucumber? cheers, Matt http://blo…

---

## [Help on skipping a before\_filter for a story](https://www.ruby-forum.com/t/help-on-skipping-a-before-filter-for-a-story/196811)

<div class="topic-metadata">

**Author:** [@Eric\_Harris-Braun](https://www.ruby-forum.com/u/Eric_Harris-Braun)\
**Replies:** 1\
**Last updated:** [September 17, 2008, 11:13pm UTC](https://www.ruby-forum.com/t/help-on-skipping-a-before-filter-for-a-story/196811 "2008-09-17T23:13:03Z")

</div>

Hi folks, I’m hoping for a bit of help on best-practices for skipping a before\_filter when running a particular step. Specifically the authentication filter. What happens is that the post (see code below) returns a…

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

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