# RSpec

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

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

---

## [Cucumber - adding a step definition](https://www.ruby-forum.com/t/cucumber-adding-a-step-definition/196915)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 0\
**Last updated:** [March 15, 2009, 6:21am UTC](https://www.ruby-forum.com/t/cucumber-adding-a-step-definition/196915 "2009-03-15T06:21:41Z")

</div>

List, Quick question about Cucumber/Gherkin. I’m considering adding ‘With’ as a step definition to support scenarios like: Given a policy With a PCF practice state And a secondary risk … I’m fairly new to ruby - …

---

## [Rspec, rspec-rails 1.1.99-12 and script/spec 'no such file to load -- spec'](https://www.ruby-forum.com/t/rspec-rspec-rails-1-1-99-12-and-script-spec-no-such-file-to-load-spec/162254)

<div class="topic-metadata">

**Author:** [@rockrep](https://www.ruby-forum.com/u/rockrep)\
**Replies:** 4\
**Last updated:** [March 15, 2009, 5:58am UTC](https://www.ruby-forum.com/t/rspec-rspec-rails-1-1-99-12-and-script-spec-no-such-file-to-load-spec/162254 "2009-03-15T05:58:52Z")

</div>

Hi David, all: I just recently upgraded to Rails 2.3.1RC2 (Mac OS.X 10.5.6, ruby 1.8.7 (2008-08-11 patchlevel 72) \[i686-darwin9\]) and have been dilligently following the instructions for upgrading rspec and rspec- r…

---

## [\[cucumber\] A Perl 5 mini-cucumber](https://www.ruby-forum.com/t/cucumber-a-perl-5-mini-cucumber/162889)

<div class="topic-metadata">

**Author:** [@Evgeny](https://www.ruby-forum.com/u/Evgeny)\
**Replies:** 0\
**Last updated:** [March 15, 2009, 5:58am UTC](https://www.ruby-forum.com/t/cucumber-a-perl-5-mini-cucumber/162889 "2009-03-15T05:58:52Z")

</div>

Hi All, I wrote a Cucumber version in Perl 5. It’s very minimal, but maybe someone will find it interesting. Check it out on GitHub - kesor/p5-cucumber: Cucumber for Perl 5 evgeny

---

## [Rspec 1.1.99.12, Rails 2.3.1, undefined method \`rspec\_options='](https://www.ruby-forum.com/t/rspec-1-1-99-12-rails-2-3-1-undefined-method-rspec-options/162675)

<div class="topic-metadata">

**Author:** [@JosSSSS\_Gomes\_Jr](https://www.ruby-forum.com/u/JosSSSS_Gomes_Jr)\
**Replies:** 2\
**Last updated:** [March 15, 2009, 1:59am UTC](https://www.ruby-forum.com/t/rspec-1-1-99-12-rails-2-3-1-undefined-method-rspec-options/162675 "2009-03-15T01:59:48Z")

</div>

Hi David, all: I recently upgraded to Rails 2.3.1RC2 (Ubuntu 8.10, ruby 1.8.7 (2008-08-11 patchlevel 72) \[i486-linux\]) and have been dilligently following the instructions for upgrading rspec and rspec-rails accordin…

---

## [Ruby - LiquidTest- Documentation](https://www.ruby-forum.com/t/ruby-liquidtest-documentation/162873)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 2\
**Last updated:** [March 14, 2009, 11:44pm UTC](https://www.ruby-forum.com/t/ruby-liquidtest-documentation/162873 "2009-03-14T23:44:34Z")

</div>

Hi all Just wondering if anyone here has seen and/or used LiquidTest\[1\]? I notice they have Cucumber integration too. Has/would anyone pay for this? (It’s out of the question for me, as there’s no Mac support.) Ch…

---

## [\[Cucumber\] When do you log in? (was- Adding a step definition)](https://www.ruby-forum.com/t/cucumber-when-do-you-log-in-was-adding-a-step-definition/162861)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 3\
**Last updated:** [March 14, 2009, 10:30pm UTC](https://www.ruby-forum.com/t/cucumber-when-do-you-log-in-was-adding-a-step-definition/162861 "2009-03-14T22:30:10Z")

</div>

On Sat, Mar 14, 2009 at 10:50 AM, Mark W. removed\_email\_address@domain.invalid wrote: On Sat, Mar 14, 2009 at 5:59 AM, Matt W. removed\_email\_address@domain.invalid wrote: I’m not sure if I like this - dependency betw…

---

## [\[webrat\] click link by title doesn't work](https://www.ruby-forum.com/t/webrat-click-link-by-title-doesnt-work/162750)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 2\
**Last updated:** [March 14, 2009, 9:05pm UTC](https://www.ruby-forum.com/t/webrat-click-link-by-title-doesnt-work/162750 "2009-03-14T21:05:13Z")

</div>

Webrat 0.4.2 doesn’t seem to allow you to click links by title. Am I missing something stupid? With steps below running in sequence, first passes, second fails Then /^I should see a view (\\w+) details link$/ do |obje…

---

## [\[cucumber\] accessing session variables](https://www.ruby-forum.com/t/cucumber-accessing-session-variables/162602)

<div class="topic-metadata">

**Author:** [@balint](https://www.ruby-forum.com/u/balint)\
**Replies:** 4\
**Last updated:** [March 14, 2009, 8:11pm UTC](https://www.ruby-forum.com/t/cucumber-accessing-session-variables/162602 "2009-03-14T20:11:00Z")

</div>

Hey, I have the following simple scenario and the step definitions: Scenario: Create album Given I am logged in as “pepito” When I go to my profile page … Given /^the user (.\*) exists$/ do |login\_name| User.find\_b…

---

## [\[cucumber\] Performance of 0.1.99?](https://www.ruby-forum.com/t/cucumber-performance-of-0-1-99/162827)

<div class="topic-metadata">

**Author:** [@luke001](https://www.ruby-forum.com/u/luke001)\
**Replies:** 4\
**Last updated:** [March 14, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/cucumber-performance-of-0-1-99/162827 "2009-03-14T17:13:00Z")

</div>

Has anyone noticed a slowdown in performance of their cucumber suite from 0.1 to 0.2alpha? I haven’t ruled out something in our suite itself, but the slowdown appeared to occur concurrently with our upgrade to 0.2alph…

---

## [Perl 5 Cucumber](https://www.ruby-forum.com/t/perl-5-cucumber/162854)

<div class="topic-metadata">

**Author:** [@Evgeny](https://www.ruby-forum.com/u/Evgeny)\
**Replies:** 0\
**Last updated:** [March 14, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/perl-5-cucumber/162854 "2009-03-14T16:33:43Z")

</div>

Hi all, I have started a mini-cucumber clone written in Perl. So for those of you working for enterprises that ruby has no foothold but perl has fortresses, this might be a nice way to get it through … it is in my …

---

## [\[cucumber\] open source projects with cucumber features](https://www.ruby-forum.com/t/cucumber-open-source-projects-with-cucumber-features/162603)

<div class="topic-metadata">

**Author:** [@balint](https://www.ruby-forum.com/u/balint)\
**Replies:** 11\
**Last updated:** [March 14, 2009, 4:11pm UTC](https://www.ruby-forum.com/t/cucumber-open-source-projects-with-cucumber-features/162603 "2009-03-14T16:11:28Z")

</div>

Hi, I was looking for some “real-world” cucumber features (mainly on github) to see how more complex features are built but I have not really found any. Could you point me to some? Thank you, Balint

---

## [How to test this view with Rspec](https://www.ruby-forum.com/t/how-to-test-this-view-with-rspec/162846)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 1\
**Last updated:** [March 14, 2009, 3:21pm UTC](https://www.ruby-forum.com/t/how-to-test-this-view-with-rspec/162846 "2009-03-14T15:21:38Z")

</div>

= flash\_messages @user = User.find(1) if current\_user == @user %new\_forum= link\_to ‘new forum’, new\_forum\_path @forum.each do |f| .group = link\_to f.name, forum\_path(f) if current\_user == @user = link\_to ‘…

---

## [Stubbing Time.zone.now for model tests fails for Rails 2.3.1](https://www.ruby-forum.com/t/stubbing-time-zone-now-for-model-tests-fails-for-rails-2-3-1/162597)

<div class="topic-metadata">

**Author:** [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Replies:** 4\
**Last updated:** [March 14, 2009, 12:25pm UTC](https://www.ruby-forum.com/t/stubbing-time-zone-now-for-model-tests-fails-for-rails-2-3-1/162597 "2009-03-14T12:25:14Z")

</div>

Our application has some code to schedule recurring tasks, with code to skip holidays and weekends. In order to test the schedule model we need to have a fixed time returned when the model is run so that the tests wil…

---

## [How do you use pending in RSpec?](https://www.ruby-forum.com/t/how-do-you-use-pending-in-rspec/162703)

<div class="topic-metadata">

**Author:** [@Bill\_V](https://www.ruby-forum.com/u/Bill_V)\
**Replies:** 6\
**Last updated:** [March 13, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/how-do-you-use-pending-in-rspec/162703 "2009-03-13T17:22:26Z")

</div>

Hi All, I’ve been working on BDD support in a test framework for Scala imaginatively called ScalaTest, and I want to add support for the notion of pending examples. I see three different “forms” of pending in RSpec, …

---

## [Profile format to give overall time...?](https://www.ruby-forum.com/t/profile-format-to-give-overall-time/162734)

<div class="topic-metadata">

**Author:** [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Replies:** 6\
**Last updated:** [March 13, 2009, 3:12pm UTC](https://www.ruby-forum.com/t/profile-format-to-give-overall-time/162734 "2009-03-13T15:12:36Z")

</div>

Hi all, How can I get cucumber to tell me how long my entire feature set has taken to run? (In the same way that RSpec does, for example) I have taken a look at the profile formatter, which is very cool and useful b…

---

## [\[Proposal\] deprecate context() at the top level](https://www.ruby-forum.com/t/proposal-deprecate-context-at-the-top-level/162765)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 0\
**Last updated:** [March 13, 2009, 2:42pm UTC](https://www.ruby-forum.com/t/proposal-deprecate-context-at-the-top-level/162765 "2009-03-13T14:42:52Z")

</div>

Hi all, There are two tickets in lighthouse that point to problems with the use of context() in RSpec: conflict with JRuby: http://rspec.lighthouseapp.com/projects/5645/tickets/728 request context() be deprecated …

---

## [\[cucumber\] Using worlds for loading fixtures](https://www.ruby-forum.com/t/cucumber-using-worlds-for-loading-fixtures/162733)

<div class="topic-metadata">

**Author:** [@ffomenko](https://www.ruby-forum.com/u/ffomenko)\
**Replies:** 3\
**Last updated:** [March 13, 2009, 12:11pm UTC](https://www.ruby-forum.com/t/cucumber-using-worlds-for-loading-fixtures/162733 "2009-03-13T12:11:25Z")

</div>

What is the right place to load fixtures specific to a given scenario? I was thinking of using Worlds. Is it the right place for loading/deleting fixtures? How do I specify which world scenario should run in?

---

## [Cucumber seems to be running steps after failed steps](https://www.ruby-forum.com/t/cucumber-seems-to-be-running-steps-after-failed-steps/162731)

<div class="topic-metadata">

**Author:** [@korny](https://www.ruby-forum.com/u/korny)\
**Replies:** 2\
**Last updated:** [March 13, 2009, 9:01am UTC](https://www.ruby-forum.com/t/cucumber-seems-to-be-running-steps-after-failed-steps/162731 "2009-03-13T09:01:57Z")

</div>

I’m a bit confused. I have a scenario similar to (numbered for clarity): Scenario: view basic Given I am logged in as 'fred' When I navigate to the 'foo' tab And I select the 'bar' node Then the node 'ba…

---

## [\[rspec/tm\] When running the textmate bundle hook using command-r I get an error about missing rubyge](https://www.ruby-forum.com/t/rspec-tm-when-running-the-textmate-bundle-hook-using-command-r-i-get-an-error-about-missing-rubyge/162673)

<div class="topic-metadata">

**Author:** [@nshb](https://www.ruby-forum.com/u/nshb)\
**Replies:** 2\
**Last updated:** [March 13, 2009, 8:19am UTC](https://www.ruby-forum.com/t/rspec-tm-when-running-the-textmate-bundle-hook-using-command-r-i-get-an-error-about-missing-rubyge/162673 "2009-03-13T08:19:50Z")

</div>

I get the following error using both edge version of the TM bundle and rspec/rspec-rails in vendor/plugins. /Users/nshb/Library/Application Support/TextMate/Bundles/ RSpec.tmbundle/Support/lib/spec/mate.rb:2:in requir…

---

## [Rails 2.2.2 Problem - button\_to\_function - nil.with\_output\_buffer](https://www.ruby-forum.com/t/rails-2-2-2-problem-button-to-function-nil-with-output-buffer/162672)

<div class="topic-metadata">

**Author:** [@karmacoma](https://www.ruby-forum.com/u/karmacoma)\
**Replies:** 1\
**Last updated:** [March 13, 2009, 6:03am UTC](https://www.ruby-forum.com/t/rails-2-2-2-problem-button-to-function-nil-with-output-buffer/162672 "2009-03-13T06:03:35Z")

</div>

Hi, I am in the process of upgrading my rails application to be compatible with rails 2.2.2. All is going well apart from a few remaining issues. My problem is: I am experiencing a test failure with what seems to be …

---

## [Run rake spec with a halt-on-errors mode?](https://www.ruby-forum.com/t/run-rake-spec-with-a-halt-on-errors-mode/162677)

<div class="topic-metadata">

**Author:** [@anton](https://www.ruby-forum.com/u/anton)\
**Replies:** 1\
**Last updated:** [March 12, 2009, 9:19pm UTC](https://www.ruby-forum.com/t/run-rake-spec-with-a-halt-on-errors-mode/162677 "2009-03-12T21:19:37Z")

</div>

Hello everybody! I am using rspec for quite a time now, and it is really a great tool! The only thing that I haven’t figured out is how to set the spec runner to a halt-on-error mode. For example a lot of browser test…

---

## [How to dummy a DB adapter?](https://www.ruby-forum.com/t/how-to-dummy-a-db-adapter/162598)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 1\
**Last updated:** [March 12, 2009, 9:46am UTC](https://www.ruby-forum.com/t/how-to-dummy-a-db-adapter/162598 "2009-03-12T09:46:35Z")

</div>

I am writing a library module to handle certain StatementInvalid type AR exceptions. I wish to catch the case where the db adapter in use is not supported by the module. I would like to test this situation and have …

---

## [Response.body.should be\_xml\_with -- how to do nested xpath matches](https://www.ruby-forum.com/t/response-body-should-be-xml-with-how-to-do-nested-xpath-matches/162328)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 14\
**Last updated:** [March 11, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/response-body-should-be-xml-with-how-to-do-nested-xpath-matches/162328 "2009-03-11T22:28:22Z")

</div>

RSpecsters: I like nested XPath expressions, because the outer XPath assertion can clip the diagnostic of the inner XPath assertion. You don’t get the whole page spewed into your face when you fault! This specifica…

---

## [\[rspec, rails\] Restful Routes in controller specs](https://www.ruby-forum.com/t/rspec-rails-restful-routes-in-controller-specs/162553)

<div class="topic-metadata">

**Author:** [@schacke](https://www.ruby-forum.com/u/schacke)\
**Replies:** 3\
**Last updated:** [March 11, 2009, 3:44pm UTC](https://www.ruby-forum.com/t/rspec-rails-restful-routes-in-controller-specs/162553 "2009-03-11T15:44:48Z")

</div>

Hi, how is it possible that I can use the restful routes helpers (e.g. new\_user\_path) in controller specs? I browsed the source code but I couldn’t find the magic. I’m just curious and would appreciate any hint… tha…

---

## [Testing for the number of occurrences of a word](https://www.ruby-forum.com/t/testing-for-the-number-of-occurrences-of-a-word/162488)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 4\
**Last updated:** [March 10, 2009, 9:35pm UTC](https://www.ruby-forum.com/t/testing-for-the-number-of-occurrences-of-a-word/162488 "2009-03-10T21:35:05Z")

</div>

Hey list, Quick question: How can I check that a given word appears a number of times on a page? The page in question includes some XML, rendered with &lts and &gts and I want to test that a given node exists 10 time…

---

## [Cucumber - RSpec matcher](https://www.ruby-forum.com/t/cucumber-rspec-matcher/162411)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 10\
**Last updated:** [March 10, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/cucumber-rspec-matcher/162411 "2009-03-10T17:46:12Z")

</div>

I must be missing something obvious here but I cannot seem to see it. I have this step definition: When /entity named “(.)" has a legal name "(.)”/ do |name, legal| myentity = Entity.find\_by\_entity\_common\_name!(name.h…

---

## [ArgumentError mystery with jruby/rspec-1.1.11](https://www.ruby-forum.com/t/argumenterror-mystery-with-jruby-rspec-1-1-11/155166)

<div class="topic-metadata">

**Author:** [@lennylmiller](https://www.ruby-forum.com/u/lennylmiller)\
**Replies:** 2\
**Last updated:** [March 10, 2009, 4:32pm UTC](https://www.ruby-forum.com/t/argumenterror-mystery-with-jruby-rspec-1-1-11/155166 "2009-03-10T16:32:30Z")

</div>

I just got bitten by a strange issue with rspec-1.1.11 and jruby 1.1.3-1.1.6RC1. I’d love to know what the problem was if anyone has any ideas. It’s almost as if, rspec didn’t like something about this particular clas…

---

## [Nokogiri selector help](https://www.ruby-forum.com/t/nokogiri-selector-help/158516)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 4\
**Last updated:** [March 10, 2009, 3:14pm UTC](https://www.ruby-forum.com/t/nokogiri-selector-help/158516 "2009-03-10T15:14:18Z")

</div>

hiya, i want the selector that would return a of a table if any td contains some text, so i can use it in click\_link\_within e.g. When I click the “show” link within the row containing “removed\_email\_address@domain.i…

---

## [Question on SQL exceptions](https://www.ruby-forum.com/t/question-on-sql-exceptions/162420)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 10\
**Last updated:** [March 10, 2009, 2:32pm UTC](https://www.ruby-forum.com/t/question-on-sql-exceptions/162420 "2009-03-10T14:32:53Z")

</div>

To prevent duplicate values in the DBMS I use a unique index on those columns. I am testing that duplicate values cannot, in fact, be added. This is the cucumber scenario: Scenario: The legal name must be unique Giv…

---

## [Stubbing before filters](https://www.ruby-forum.com/t/stubbing-before-filters/162490)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 0\
**Last updated:** [March 10, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/stubbing-before-filters/162490 "2009-03-10T14:22:21Z")

</div>

Can folks who write controller specs and deal with before filters read and comment on this ticket: http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/724-stub\_before\_filters#ticket-724-2 I’m on the fence and w…

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

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