# RSpec

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

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

---

## [Cucumber/webrat, need to set user in session, can't stub or mock. 	Fixtures?](https://www.ruby-forum.com/t/cucumber-webrat-need-to-set-user-in-session-cant-stub-or-mock-fixtures/166615)

<div class="topic-metadata">

**Author:** [@biot023](https://www.ruby-forum.com/u/biot023)\
**Replies:** 12\
**Last updated:** [April 29, 2009, 7:23am UTC](https://www.ruby-forum.com/t/cucumber-webrat-need-to-set-user-in-session-cant-stub-or-mock-fixtures/166615 "2009-04-29T07:23:28Z")

</div>

Hi – I’m assuming that there are excellent reasons for not enabling stubs & mocks in cucumber, but I find myself in a bit of a pickle without them. Basically, I want to write a feature that has the home page displayin…

---

## [\[cucumber\] Use of Scenario Outline for validation stuff?](https://www.ruby-forum.com/t/cucumber-use-of-scenario-outline-for-validation-stuff/166665)

<div class="topic-metadata">

**Author:** [@jerefrer](https://www.ruby-forum.com/u/jerefrer)\
**Replies:** 6\
**Last updated:** [April 28, 2009, 4:25pm UTC](https://www.ruby-forum.com/t/cucumber-use-of-scenario-outline-for-validation-stuff/166665 "2009-04-28T16:25:14Z")

</div>

Hi there ! I was wondering if the way I test the validation of my forms is right or not. So here’s a little example : Imagine you have a form with some validations designed to create some object. You want to test it …

---

## [\[rspec\] be\_something accepts nils](https://www.ruby-forum.com/t/rspec-be-something-accepts-nils/162759)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 5\
**Last updated:** [April 28, 2009, 3:34pm UTC](https://www.ruby-forum.com/t/rspec-be-something-accepts-nils/162759 "2009-04-28T15:34:00Z")

</div>

Hi Just noticed that the behaviour of @cow.should\_not be\_hungry is not the same as @cow.hungry?.should == false # nil also passes Don’t know how this has escaped me for so long =) What’s the thinking behind this? …

---

## [Cucumber custome reports](https://www.ruby-forum.com/t/cucumber-custome-reports/166653)

<div class="topic-metadata">

**Author:** [@sarathx](https://www.ruby-forum.com/u/sarathx)\
**Replies:** 3\
**Last updated:** [April 28, 2009, 11:29am UTC](https://www.ruby-forum.com/t/cucumber-custome-reports/166653 "2009-04-28T11:29:40Z")

</div>

Hi, I need to create a custom report based on cucumber output. I am thinking of two ways to do this. Either I have to write a java application to fetch the values like execution time for each scenarios along with i…

---

## [\[cucumber\] Setting a constant in step definition](https://www.ruby-forum.com/t/cucumber-setting-a-constant-in-step-definition/166578)

<div class="topic-metadata">

**Author:** [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Replies:** 11\
**Last updated:** [April 28, 2009, 8:24am UTC](https://www.ruby-forum.com/t/cucumber-setting-a-constant-in-step-definition/166578 "2009-04-28T08:24:27Z")

</div>

Currently I have a very simple constants implementation being loaded as a Rails initialiser module MVOR module Postage THRESHOLD = BigDecimal.new(‘6.99’) RATE = BigDecimal.new(‘30.00’) end end My scenarios of my…

---

## [\[cucumber\] Where does STDOUT go?](https://www.ruby-forum.com/t/cucumber-where-does-stdout-go/166620)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [April 28, 2009, 4:17am UTC](https://www.ruby-forum.com/t/cucumber-where-does-stdout-go/166620 "2009-04-28T04:17:46Z")

</div>

If one invokes a Ruby script from a cucumber step definition and that script contains “puts” statements then where does the output go? I have a script that when run from the command line displays “puts” output in the…

---

## [Background and scenario outline interaction](https://www.ruby-forum.com/t/background-and-scenario-outline-interaction/166425)

<div class="topic-metadata">

**Author:** [@wolfmanjm](https://www.ruby-forum.com/u/wolfmanjm)\
**Replies:** 6\
**Last updated:** [April 28, 2009, 1:32am UTC](https://www.ruby-forum.com/t/background-and-scenario-outline-interaction/166425 "2009-04-28T01:32:02Z")

</div>

Hi, I was surprised by this so I suspect it may be a bug. I have a Scenario Outline, and a Background in my Feature and nothing else, The Background got executed 1 more time than expected. Details are the Scenario O…

---

## [Problems running features with Textmate Cucumber bundle](https://www.ruby-forum.com/t/problems-running-features-with-textmate-cucumber-bundle/166524)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 10\
**Last updated:** [April 27, 2009, 9:21pm UTC](https://www.ruby-forum.com/t/problems-running-features-with-textmate-cucumber-bundle/166524 "2009-04-27T21:21:39Z")

</div>

I finally plunked down for the beta RSpec bundle and I’m working through the initial example. Although I’m a fairly experienced RSpec user, I’m stlll learning new tricks. Anyway, I’m going though the mastermind exam…

---

## [Describe 'a spec for a helper that takes a block' i.should need\_to\_do\_this?](https://www.ruby-forum.com/t/describe-a-spec-for-a-helper-that-takes-a-block-i-should-need-to-do-this/166610)

<div class="topic-metadata">

**Author:** [@Higgaion](https://www.ruby-forum.com/u/Higgaion)\
**Replies:** 0\
**Last updated:** [April 27, 2009, 8:48pm UTC](https://www.ruby-forum.com/t/describe-a-spec-for-a-helper-that-takes-a-block-i-should-need-to-do-this/166610 "2009-04-27T20:48:12Z")

</div>

i have a helper like this: def swf\_upload\_tag( upload\_url, options = {}, &block) # irelavant stuff removed button\_text = capture(&block) unless button\_text.blank? options.merge!( :button\_text =\> button\_text ) end …

---

## [Error using Norwegian with cucumber](https://www.ruby-forum.com/t/error-using-norwegian-with-cucumber/166582)

<div class="topic-metadata">

**Author:** [@Peter\_Nicolai\_Motzf](https://www.ruby-forum.com/u/Peter_Nicolai_Motzf)\
**Replies:** 1\
**Last updated:** [April 27, 2009, 5:09pm UTC](https://www.ruby-forum.com/t/error-using-norwegian-with-cucumber/166582 "2009-04-27T17:09:48Z")

</div>

Hi I am experiencing a problem when using Cucumber with Norwegian language. I have added the files and the stacktrace on gist: The problem is that when we use NÃ¥r (When) and SÃ¥ (Then) in the steps file, it fails…

---

## [\[Cucumber\] Screencast about tags, tables and scenario outlines](https://www.ruby-forum.com/t/cucumber-screencast-about-tags-tables-and-scenario-outlines/166581)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 0\
**Last updated:** [April 27, 2009, 4:27pm UTC](https://www.ruby-forum.com/t/cucumber-screencast-about-tags-tables-and-scenario-outlines/166581 "2009-04-27T16:27:24Z")

</div>

Ryan B.t of Railscasts fame has just released this: Very very good - check it out! Aslak

---

## [RSPEC book example in Chapter 3](https://www.ruby-forum.com/t/rspec-book-example-in-chapter-3/166528)

<div class="topic-metadata">

**Author:** [@GSBrandon\_H](https://www.ruby-forum.com/u/GSBrandon_H)\
**Replies:** 3\
**Last updated:** [April 27, 2009, 4:00pm UTC](https://www.ruby-forum.com/t/rspec-book-example-in-chapter-3/166528 "2009-04-27T16:00:21Z")

</div>

Hi! I’m going through the rspec book in beta form right now and hit a snag in chapter three. I am developing an application in parallel to the book example instead of writing the book example word for word. To the b…

---

## [RSPEC book example in Chapter 3](https://www.ruby-forum.com/t/rspec-book-example-in-chapter-3/166575)

<div class="topic-metadata">

**Author:** [@GSBrandon\_H](https://www.ruby-forum.com/u/GSBrandon_H)\
**Replies:** 0\
**Last updated:** [April 27, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/rspec-book-example-in-chapter-3/166575 "2009-04-27T15:54:30Z")

</div>

Hi! I’m going through the rspec book in beta form right now and hit a snag in chapter three. I am developing an application in parallel to the book example instead of writing the book example word for word. To the b…

---

## [Automating and end to end functional test](https://www.ruby-forum.com/t/automating-and-end-to-end-functional-test/166454)

<div class="topic-metadata">

**Author:** [@jmac](https://www.ruby-forum.com/u/jmac)\
**Replies:** 4\
**Last updated:** [April 27, 2009, 10:38am UTC](https://www.ruby-forum.com/t/automating-and-end-to-end-functional-test/166454 "2009-04-27T10:38:19Z")

</div>

Hi, I am new to ruby and rspec. I would like to use ruby/rspec/cucumber to automate acceptance tests for a number of integrated systems at my work. I get the basics of cucumber features, but how do I chain these test…

---

## [Running a specific feature when set up with selenium](https://www.ruby-forum.com/t/running-a-specific-feature-when-set-up-with-selenium/166526)

<div class="topic-metadata">

**Author:** [@barunio](https://www.ruby-forum.com/u/barunio)\
**Replies:** 0\
**Last updated:** [April 26, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/running-a-specific-feature-when-set-up-with-selenium/166526 "2009-04-26T21:51:26Z")

</div>

I’ve set up my cucumber.yml file so that i have a default profile and a selenium profile as described at the end of this wiki page: http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium This works great wh…

---

## [Jruby require 'jcode' problem and cucumber 1.2.0](https://www.ruby-forum.com/t/jruby-require-jcode-problem-and-cucumber-1-2-0/166492)

<div class="topic-metadata">

**Author:** [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Replies:** 1\
**Last updated:** [April 26, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/jruby-require-jcode-problem-and-cucumber-1-2-0/166492 "2009-04-26T12:50:38Z")

</div>

After upgrading to cucumber 0.3.0 from 0.1.16 I’m getting this error when I try to run a feature: /Users/steve/src/jruby-1.2.0/lib/ruby/1.8/jcode.rb:66:in end\_regexp': too short multibyte code string: /\[\\xc0-\\xdf\]\[\\x…

---

## [Cucumber/RSpec for an existing Rails project - generate rspec models and controllers?](https://www.ruby-forum.com/t/cucumber-rspec-for-an-existing-rails-project-generate-rspec-models-and-controllers/166497)

<div class="topic-metadata">

**Author:** [@biglandowner](https://www.ruby-forum.com/u/biglandowner)\
**Replies:** 1\
**Last updated:** [April 26, 2009, 11:34am UTC](https://www.ruby-forum.com/t/cucumber-rspec-for-an-existing-rails-project-generate-rspec-models-and-controllers/166497 "2009-04-26T11:34:55Z")

</div>

Hi, I would like to use Cucumber and RSpec for my existing Rails project. I am now reasonably comfortable with the use of these, having studied the RSpec Book and various online resources. I am however unsure about o…

---

## [Rspec-rails fails to find a controller name](https://www.ruby-forum.com/t/rspec-rails-fails-to-find-a-controller-name/166406)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [April 25, 2009, 4:12pm UTC](https://www.ruby-forum.com/t/rspec-rails-fails-to-find-a-controller-name/166406 "2009-04-25T16:12:44Z")

</div>

Hi, I have a problem that seems a bit strange. No matter how I specify the controller name in a rails controller rspec I am always presented with ‘HostController Retrieving /host via GET should redirect if not logged …

---

## [Cucumber ".should contain(expected) does but fails anyway](https://www.ruby-forum.com/t/cucumber-should-contain-expected-does-but-fails-anyway/166183)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 26\
**Last updated:** [April 24, 2009, 7:10pm UTC](https://www.ruby-forum.com/t/cucumber-should-contain-expected-does-but-fails-anyway/166183 "2009-04-24T19:10:23Z")

</div>

This is the step definition: When /the xml document should have the Bank of Canada title/ do expected = ‘Bank of Canada: Noon Foreign Exchange Rates’ fx\_doc = ForexCASource.new(@xchg\_source) puts fx\_doc.xpath(’//rdf…

---

## [\[Rspec, Cucumber\] About the use of Scenario Outline for validation 	stuff](https://www.ruby-forum.com/t/rspec-cucumber-about-the-use-of-scenario-outline-for-validation-stuff/166364)

<div class="topic-metadata">

**Author:** [@JSSSSrSSSSmy\_FRERE](https://www.ruby-forum.com/u/JSSSSrSSSSmy_FRERE)\
**Replies:** 0\
**Last updated:** [April 24, 2009, 10:27am UTC](https://www.ruby-forum.com/t/rspec-cucumber-about-the-use-of-scenario-outline-for-validation-stuff/166364 "2009-04-24T10:27:07Z")

</div>

Hi there ! I was wondering if the way I test the validation of my forms is right or not. So here’s a little example : Imagine you have a form with some validations designed to create some object. You want to test it …

---

## [Style issue](https://www.ruby-forum.com/t/style-issue/166320)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 7\
**Last updated:** [April 24, 2009, 9:51am UTC](https://www.ruby-forum.com/t/style-issue/166320 "2009-04-24T09:51:20Z")

</div>

In one of my features I have to check to see if a file is created by an external script and then determine if that file contains specific information. So, I ended up with these step definitions: When /currency exchan…

---

## [\[Cucumber, Rails\] Load path hell with plugins /extensions](https://www.ruby-forum.com/t/cucumber-rails-load-path-hell-with-plugins-extensions/166348)

<div class="topic-metadata">

**Author:** [@Ken\_Mayer](https://www.ruby-forum.com/u/Ken_Mayer)\
**Replies:** 0\
**Last updated:** [April 24, 2009, 6:59am UTC](https://www.ruby-forum.com/t/cucumber-rails-load-path-hell-with-plugins-extensions/166348 "2009-04-24T06:59:11Z")

</div>

I discovered this while debugging a RadiantCMS extension: cucumber uses ‘require’ to load step definitions, and since I loaded the rails environment (in features/support/env.rb) for testing, and radiant necessarily ad…

---

## [About the use of Scenario Outline for validation stuff](https://www.ruby-forum.com/t/about-the-use-of-scenario-outline-for-validation-stuff/166305)

<div class="topic-metadata">

**Author:** [@JSSSSrSSSSmy\_FRERE](https://www.ruby-forum.com/u/JSSSSrSSSSmy_FRERE)\
**Replies:** 1\
**Last updated:** [April 24, 2009, 6:36am UTC](https://www.ruby-forum.com/t/about-the-use-of-scenario-outline-for-validation-stuff/166305 "2009-04-24T06:36:58Z")

</div>

Hi there ! I was wondering if the way I test the validation of my forms is right or not. So here’s a little example : Imagine you have a form with some validations designed to create some object. You want to test it …

---

## [\[Cucumber\] Textmate support for Background](https://www.ruby-forum.com/t/cucumber-textmate-support-for-background/166193)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 2\
**Last updated:** [April 24, 2009, 6:32am UTC](https://www.ruby-forum.com/t/cucumber-textmate-support-for-background/166193 "2009-04-24T06:32:52Z")

</div>

Howdy, Want to use the Background feature support and was curious if text mate support for it was coming or I could get a pointer on how to do text highlighting for “Background” was able to edit it as a Snippet but n…

---

## [Select box with Webrat](https://www.ruby-forum.com/t/select-box-with-webrat/166180)

<div class="topic-metadata">

**Author:** [@mikej](https://www.ruby-forum.com/u/mikej)\
**Replies:** 4\
**Last updated:** [April 23, 2009, 6:14pm UTC](https://www.ruby-forum.com/t/select-box-with-webrat/166180 "2009-04-23T18:14:11Z")

</div>

I have a select box: – Select Topic – Pollution I would like to select the pollution option from the list using webrat. I’ve tried: select “Pollution”, :from =\> “temp\_aspect\[topic\_id\]” select “Pollution” In b…

---

## [Cucumber - step negating another expecting step](https://www.ruby-forum.com/t/cucumber-step-negating-another-expecting-step/165680)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rivera\_P](https://www.ruby-forum.com/u/Joaquin_Rivera_P)\
**Replies:** 20\
**Last updated:** [April 23, 2009, 5:37pm UTC](https://www.ruby-forum.com/t/cucumber-step-negating-another-expecting-step/165680 "2009-04-23T17:37:46Z")

</div>

hey there, this here may be a little too general, and maybe is only a though sharing, but would be nice to hear what you think. What is your opinion about expectation steps that negates another expectation step? fo…

---

## [Why RSpec?](https://www.ruby-forum.com/t/why-rspec/166127)

<div class="topic-metadata">

**Author:** [@thekernel](https://www.ruby-forum.com/u/thekernel)\
**Replies:** 17\
**Last updated:** [April 23, 2009, 3:33am UTC](https://www.ruby-forum.com/t/why-rspec/166127 "2009-04-23T03:33:01Z")

</div>

I like Shoulda. Sometimes I like plain old Test::Unit. Cucumber gives me a different thought process. I’d just like to hear some thoughts on why RSpec? What does it buy me that I can’t get with Shoulda? I just can…

---

## [Passing custom arguments to an rspec script. Is this possible?](https://www.ruby-forum.com/t/passing-custom-arguments-to-an-rspec-script-is-this-possible/166219)

<div class="topic-metadata">

**Author:** [@stephanie](https://www.ruby-forum.com/u/stephanie)\
**Replies:** 3\
**Last updated:** [April 23, 2009, 2:51am UTC](https://www.ruby-forum.com/t/passing-custom-arguments-to-an-rspec-script-is-this-possible/166219 "2009-04-23T02:51:18Z")

</div>

Hi, I am writing a rspec script to use with selenium-client. I would like to pass the script some custom arguments in the command line to change a few test settings in the script. However, rspec gives errors when I p…

---

## [\[Cucumber\] Tables](https://www.ruby-forum.com/t/cucumber-tables/166078)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 22\
**Last updated:** [April 23, 2009, 2:10am UTC](https://www.ruby-forum.com/t/cucumber-tables/166078 "2009-04-23T02:10:56Z")

</div>

Being the author of Cucumber, some of you might be surprised that I ask this question: How should I go about to implement a Cucumber feature and step definition with the following data? 1) Religious Menu · GitHub (…

---

## [\[Cucumber\] Options in tables](https://www.ruby-forum.com/t/cucumber-options-in-tables/166137)

<div class="topic-metadata">

**Author:** [@nigelthorne](https://www.ruby-forum.com/u/nigelthorne)\
**Replies:** 6\
**Last updated:** [April 23, 2009, 12:27am UTC](https://www.ruby-forum.com/t/cucumber-options-in-tables/166137 "2009-04-23T00:27:57Z")

</div>

In Cucumber I want to remove duplication from my examples tables. see With duplication removed · GitHub for an example of the type of situation I am facing. I would like the second example to be equivalent to the fir…

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

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