# RSpec

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

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

---

## [Rspec model testing - test on user defined validation- How do I test that the create failed](https://www.ruby-forum.com/t/rspec-model-testing-test-on-user-defined-validation-how-do-i-test-that-the-create-failed/157908)

<div class="topic-metadata">

**Author:** [@kenwei](https://www.ruby-forum.com/u/kenwei)\
**Replies:** 3\
**Last updated:** [January 16, 2009, 11:11pm UTC](https://www.ruby-forum.com/t/rspec-model-testing-test-on-user-defined-validation-how-do-i-test-that-the-create-failed/157908 "2009-01-16T23:11:14Z")

</div>

I’m new to rspec and looking for way to test a validation I added to a model. The test checks to see that if field1 has a value then field2 must be nil and vice versa. When I did the rspec\_scaffold it generated one…

---

## [Which webrat gem should be used?](https://www.ruby-forum.com/t/which-webrat-gem-should-be-used/157854)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 4\
**Last updated:** [January 16, 2009, 8:19pm UTC](https://www.ruby-forum.com/t/which-webrat-gem-should-be-used/157854 "2009-01-16T20:19:44Z")

</div>

Hi guys. Which webrat gem should be used? There seem to be a few: $ gem search -r webrat \*\*\* REMOTE GEMS \*\*\* aslakhellesoy-webrat (0.3.2.2) benschwarz-webrat (0.3.2.1) brynary-webrat (0.3.2.2) flazz-webrat (0.3.2.…

---

## [OT: Who To Ask About Screw.Unit?](https://www.ruby-forum.com/t/ot-who-to-ask-about-screw-unit/157757)

<div class="topic-metadata">

**Author:** [@cwd](https://www.ruby-forum.com/u/cwd)\
**Replies:** 7\
**Last updated:** [January 16, 2009, 4:43pm UTC](https://www.ruby-forum.com/t/ot-who-to-ask-about-screw-unit/157757 "2009-01-16T16:43:11Z")

</div>

I’ve been using Screw.Unit for some js testing and like the similarity to rSpec, but information is pretty scarce on the Web. What I’m trying to sort out is how to spec a jQuery click handler that submits a form (basi…

---

## [Documentation about the returns method](https://www.ruby-forum.com/t/documentation-about-the-returns-method/157740)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 3\
**Last updated:** [January 16, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/documentation-about-the-returns-method/157740 "2009-01-16T16:20:32Z")

</div>

Hi, From the railscasts website source code, in the episodes\_controller\_spec I read: it “index action with search should search published episodes” do Episode.expects(:search\_published).with(‘foo’).returns(Episode.al…

---

## [GivenScenario in cucumber](https://www.ruby-forum.com/t/givenscenario-in-cucumber/157847)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 2\
**Last updated:** [January 16, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/givenscenario-in-cucumber/157847 "2009-01-16T14:47:20Z")

</div>

Hey all, I’ve read http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/3-%20%20create-givenscenario-dependency-accross-feature-file , and would like to share another idea about this. I’m building a blog at…

---

## [Cucumber HTML in IE6 (part 2)](https://www.ruby-forum.com/t/cucumber-html-in-ie6-part-2/157899)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 0\
**Last updated:** [January 16, 2009, 1:00pm UTC](https://www.ruby-forum.com/t/cucumber-html-in-ie6-part-2/157899 "2009-01-16T13:00:55Z")

</div>

Hi Guys, 2009/1/15 aslak hellesoy removed\_email\_address@domain.invalid: I’m definitely interested in supporting IE6 as long as I don’t have to fight with its brokenness. I’ll gladly accept patches. Thanks for shari…

---

## [Step tables](https://www.ruby-forum.com/t/step-tables/157796)

<div class="topic-metadata">

**Author:** [@jmcervera](https://www.ruby-forum.com/u/jmcervera)\
**Replies:** 4\
**Last updated:** [January 16, 2009, 12:28pm UTC](https://www.ruby-forum.com/t/step-tables/157796 "2009-01-16T12:28:22Z")

</div>

I am having some trouble using step tables. I am trying with an step similar to the sample step generarated by the cucumber generator Then /^I should see the following froobles:$/ do |froobles| froobles.raw\[1…-1\].eac…

---

## [Help with regexp in matcher](https://www.ruby-forum.com/t/help-with-regexp-in-matcher/157538)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 17\
**Last updated:** [January 16, 2009, 9:08am UTC](https://www.ruby-forum.com/t/help-with-regexp-in-matcher/157538 "2009-01-16T09:08:19Z")

</div>

This is giving me an error: When /?:(log|sign)?:(i|o)n success message/ do Then “welcome message” end To the effect that: /usr/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in gem\_original\_require': ./featur…

---

## [Cucumber HTML in IE6](https://www.ruby-forum.com/t/cucumber-html-in-ie6/157821)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 5\
**Last updated:** [January 16, 2009, 12:05am UTC](https://www.ruby-forum.com/t/cucumber-html-in-ie6/157821 "2009-01-16T00:05:22Z")

</div>

Hi, The users are using IE6. The Cucumber HTML appears fine in firefox, opera, IE7 etc. However, I am not receiving any colouring in IE6. I put the cucumber.css through the w3c validator and no errors. Is anyone els…

---

## [New rescue\_from handling in rspec-rails 1.1.12](https://www.ruby-forum.com/t/new-rescue-from-handling-in-rspec-rails-1-1-12/157768)

<div class="topic-metadata">

**Author:** [@kampers](https://www.ruby-forum.com/u/kampers)\
**Replies:** 2\
**Last updated:** [January 15, 2009, 9:36pm UTC](https://www.ruby-forum.com/t/new-rescue-from-handling-in-rspec-rails-1-1-12/157768 "2009-01-15T21:36:17Z")

</div>

Howdy, This change to rspec-rails in 1.1.12 tripped me up: (or, see the relevant Lighthouse ticket, here: Lighthouse - Beautifully Simple Issue Tracking) Basically, we were depending on that “bug” in 1.1.11, since i…

---

## [\[cucumber\] missing the command --line option](https://www.ruby-forum.com/t/cucumber-missing-the-command-line-option/157728)

<div class="topic-metadata">

**Author:** [@Fernando\_GarcSSS\_a\_S](https://www.ruby-forum.com/u/Fernando_GarcSSS_a_S)\
**Replies:** 4\
**Last updated:** [January 15, 2009, 4:45pm UTC](https://www.ruby-forum.com/t/cucumber-missing-the-command-line-option/157728 "2009-01-15T16:45:23Z")

</div>

Cucus, previous versions of cucumber had a command --line option that let you run only one scenario given its line at the feature file. Now, as far as I know, to do the same thing (run a specific scenario) I have to …

---

## [Rpsec-rails overwriting RAILS\_ENV?](https://www.ruby-forum.com/t/rpsec-rails-overwriting-rails-env/157783)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 1\
**Last updated:** [January 15, 2009, 3:56pm UTC](https://www.ruby-forum.com/t/rpsec-rails-overwriting-rails-env/157783 "2009-01-15T15:56:40Z")

</div>

Hi folks, We have a “features” environment for Rails, where we run the Cucumber stuff. This lets us run specs and features in different databases, which can be handy. I think I’ve found that rspec-rails 1.1.12 is doi…

---

## [IRB-like utility for Cucumber?](https://www.ruby-forum.com/t/irb-like-utility-for-cucumber/157714)

<div class="topic-metadata">

**Author:** [@hoshbad](https://www.ruby-forum.com/u/hoshbad)\
**Replies:** 14\
**Last updated:** [January 15, 2009, 3:03am UTC](https://www.ruby-forum.com/t/irb-like-utility-for-cucumber/157714 "2009-01-15T03:03:33Z")

</div>

Hello RSpec forum, So…I realize this is a bit of a crazy question, but I wanted to throw it out there to see what answers came back: is there any way to start an “interactive Cucumber” session similar to irb? For exa…

---

## [Childrens book](https://www.ruby-forum.com/t/childrens-book/157753)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 6\
**Last updated:** [January 15, 2009, 2:53am UTC](https://www.ruby-forum.com/t/childrens-book/157753 "2009-01-15T02:53:01Z")

</div>

In a weak moment of vanity I googled myself and found this: http://www.target.com/Island-Care-Beans-VeggieTales-Personalized/dp/B001N8YQZS So I’m starring in a childrens’ book with a cuke. WEIRD

---

## [Spec\_server and re-loads of files](https://www.ruby-forum.com/t/spec-server-and-re-loads-of-files/157732)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 4\
**Last updated:** [January 15, 2009, 1:15am UTC](https://www.ruby-forum.com/t/spec-server-and-re-loads-of-files/157732 "2009-01-15T01:15:20Z")

</div>

I got spec\_server working today, and was literally ecstatic about the speed of response from running a spec. Yelps and all-sorts, very un- British, I can tell you :wink: However I’m starting to notice that it doesn’t …

---

## [Adding a custom matcher to a controller](https://www.ruby-forum.com/t/adding-a-custom-matcher-to-a-controller/157681)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 5\
**Last updated:** [January 14, 2009, 11:44pm UTC](https://www.ruby-forum.com/t/adding-a-custom-matcher-to-a-controller/157681 "2009-01-14T23:44:31Z")

</div>

Hey list, I’ve written a custom matcher (gist:46858 · GitHub) which I’d like to use in Cucumber specifically. In my spec\_helper, I have required the file where the matcher lives in, and added it to Spec::Runner.confi…

---

## [Please clarify test / step definition return value?](https://www.ruby-forum.com/t/please-clarify-test-step-definition-return-value/157726)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 4\
**Last updated:** [January 14, 2009, 11:30pm UTC](https://www.ruby-forum.com/t/please-clarify-test-step-definition-return-value/157726 "2009-01-14T23:30:41Z")

</div>

I have been working under the impression that that tests/step definitions worked on a simple boolean logic and behaved like ruby methods, the last value is returned. Thus, in my understanding, if the return value is …

---

## [Missing model attribute in cucumber test](https://www.ruby-forum.com/t/missing-model-attribute-in-cucumber-test/157724)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 7\
**Last updated:** [January 14, 2009, 9:25pm UTC](https://www.ruby-forum.com/t/missing-model-attribute-in-cucumber-test/157724 "2009-01-14T21:25:32Z")

</div>

Rails 2.2.2 Cucumber 0.1.15 SQLite3 I have this migration for the User model: class CreateUsers \< ActiveRecord::Migration def self.up create\_table :users do |t| … t.string :sms\_address t.boolean :user\_admin…

---

## [Understanding before(:all)](https://www.ruby-forum.com/t/understanding-before-all/157669)

<div class="topic-metadata">

**Author:** [@davidjrice](https://www.ruby-forum.com/u/davidjrice)\
**Replies:** 2\
**Last updated:** [January 14, 2009, 4:51pm UTC](https://www.ruby-forum.com/t/understanding-before-all/157669 "2009-01-14T16:51:48Z")

</div>

I had, for historic reasons, a setup on a group of specs: before(:all) do @contents = \[%w(this that), %w(this other)\] FasterCSV.stub!(:open).and\_return(@contents) @filename = ‘test\_filename’ end When I ran the sing…

---

## [Getting started - very much a beginner](https://www.ruby-forum.com/t/getting-started-very-much-a-beginner/157449)

<div class="topic-metadata">

**Author:** [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Replies:** 4\
**Last updated:** [January 14, 2009, 4:24pm UTC](https://www.ruby-forum.com/t/getting-started-very-much-a-beginner/157449 "2009-01-14T16:24:40Z")

</div>

A hope my ignorance is acceptable here. I have, to this point, programmed in Ruby mostly using my awareness of procedural programming; I’ve written a small number of very useful programs for myself. I’m starting to us…

---

## [Example on the Cucumber home page](https://www.ruby-forum.com/t/example-on-the-cucumber-home-page/157699)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 1\
**Last updated:** [January 14, 2009, 4:04pm UTC](https://www.ruby-forum.com/t/example-on-the-cucumber-home-page/157699 "2009-01-14T16:04:03Z")

</div>

Great work on the logo and website, Aslak & Co! It looks great, and and the prominent six steps to using Cucumber is exactly what newbs. I have one question about step #2. The Given-block initialises a new Calculator …

---

## [Autospec, with autofeature, with options](https://www.ruby-forum.com/t/autospec-with-autofeature-with-options/157684)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 2\
**Last updated:** [January 14, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/autospec-with-autofeature-with-options/157684 "2009-01-14T16:01:42Z")

</div>

Hey list, I’m trying to run autospec with AUTOFEATURE=true, but my features are written in Dutch. How can I throw --language nl to cucumber run from within autospec?.. cheers, bartz

---

## [Eql not matching identical hashes unless they actually are the same object](https://www.ruby-forum.com/t/eql-not-matching-identical-hashes-unless-they-actually-are-the-same-object/157667)

<div class="topic-metadata">

**Author:** [@mosoleu](https://www.ruby-forum.com/u/mosoleu)\
**Replies:** 3\
**Last updated:** [January 14, 2009, 12:19pm UTC](https://www.ruby-forum.com/t/eql-not-matching-identical-hashes-unless-they-actually-are-the-same-object/157667 "2009-01-14T12:19:05Z")

</div>

rspec 1.1.11 and it’s rails sidekick. After writing a few specs for an object I created that inherits form an Hash I noticed that eql wasn’t matching hashes that where actually matching (I’m pretty sure it worked fine…

---

## [Autospec doesn't pick up my plugin specs](https://www.ruby-forum.com/t/autospec-doesnt-pick-up-my-plugin-specs/157665)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 1\
**Last updated:** [January 14, 2009, 11:50am UTC](https://www.ruby-forum.com/t/autospec-doesnt-pick-up-my-plugin-specs/157665 "2009-01-14T11:50:10Z")

</div>

'ello list, I’m trying to develop a plugin with rspec, but I can’t seem to get autospec to watch my spec files. I’ve used the rspec\_plugin to create my plugin, so I have a spec directory with a pending step in it. Do …

---

## [\[cucumber\] before/after scenarios](https://www.ruby-forum.com/t/cucumber-before-after-scenarios/155885)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 7\
**Last updated:** [January 14, 2009, 10:45am UTC](https://www.ruby-forum.com/t/cucumber-before-after-scenarios/155885 "2009-01-14T10:45:04Z")

</div>

Hi Guys, Sorry for the double-whine but I’ve seen references to these listeners but not a lot of luck finding any details. So…that’s it: Setup/Teardown Before/After scenarios…what’s the scoop? Thanks, Tim (Also, t…

---

## [New Cucumber website and logo!](https://www.ruby-forum.com/t/new-cucumber-website-and-logo/157668)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 0\
**Last updated:** [January 14, 2009, 10:14am UTC](https://www.ruby-forum.com/t/new-cucumber-website-and-logo/157668 "2009-01-14T10:14:30Z")

</div>

Hi all, The logo contest is over and the winner is Gideon Bullock! Exactly 545 people voted on a logo, and Gideon got 22% of the votes. Daniel L. came second with 19% and Dan Ryan third with 14%. I’d like to thank ev…

---

## [\[Cucumber\] after feature hook?](https://www.ruby-forum.com/t/cucumber-after-feature-hook/156933)

<div class="topic-metadata">

**Author:** [@aidy\_lewis](https://www.ruby-forum.com/u/aidy_lewis)\
**Replies:** 7\
**Last updated:** [January 14, 2009, 9:56am UTC](https://www.ruby-forum.com/t/cucumber-after-feature-hook/156933 "2009-01-14T09:56:52Z")

</div>

Hi, Is there a hook or a method to execute some code after a whole feature has run or will I need to embed that in a ‘Then’? Regards Aidy

---

## [Cucumber: acceptance testing OAuth](https://www.ruby-forum.com/t/cucumber-acceptance-testing-oauth/157058)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 3\
**Last updated:** [January 14, 2009, 9:53am UTC](https://www.ruby-forum.com/t/cucumber-acceptance-testing-oauth/157058 "2009-01-14T09:53:20Z")

</div>

Hi, We’re adding OAuth support for our API, and I paired with the guy who’s spiked it today to try and write some features to drive out the behaviour we need. It ended up getting quite tricky, so if you don’t mind I’…

---

## [Constraints / Global requirements](https://www.ruby-forum.com/t/constraints-global-requirements/157143)

<div class="topic-metadata">

**Author:** [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Replies:** 20\
**Last updated:** [January 14, 2009, 7:31am UTC](https://www.ruby-forum.com/t/constraints-global-requirements/157143 "2009-01-14T07:31:23Z")

</div>

I have two related questions: What is the best way to express global requirements, and how does one do it in Cucumber. The first question is the one I’m most interested in right now. By a global requirement I’m tal…

---

## [Using has\_selector to identify responses](https://www.ruby-forum.com/t/using-has-selector-to-identify-responses/157631)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [January 13, 2009, 11:42pm UTC](https://www.ruby-forum.com/t/using-has-selector-to-identify-responses/157631 "2009-01-13T23:42:43Z")

</div>

This is more of a “best practices” question. Earlier, when I was trying to understand what it was I was supposed to be testing with cucumber, I was advised that I should test for text elements contained in the respons…

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

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