# RSpec

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

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

---

## [Testing multiple sessions in cucumber/webrat](https://www.ruby-forum.com/t/testing-multiple-sessions-in-cucumber-webrat/161673)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 6\
**Last updated:** [April 22, 2009, 10:50pm UTC](https://www.ruby-forum.com/t/testing-multiple-sessions-in-cucumber-webrat/161673 "2009-04-22T22:50:27Z")

</div>

Is it possible to have a scenario where you are testing the interaction between two different session? i.e. Given User A clicks this link Then User B should see this It used to be possible, but don’t know if it stil…

---

## [\[RSpec\] Clarification on using shared\_examples\_for on a Rails Controller](https://www.ruby-forum.com/t/rspec-clarification-on-using-shared-examples-for-on-a-rails-controller/166211)

<div class="topic-metadata">

**Author:** [@gers4302](https://www.ruby-forum.com/u/gers4302)\
**Replies:** 3\
**Last updated:** [April 22, 2009, 10:18pm UTC](https://www.ruby-forum.com/t/rspec-clarification-on-using-shared-examples-for-on-a-rails-controller/166211 "2009-04-22T22:18:24Z")

</div>

I have a Rails controller that I am using ‘before\_filter’ on certain actions to assign some extra variables. I noticed the ‘shared\_examples\_for’ method and thought this would be a good way to test that the given act…

---

## [Problems withe the template](https://www.ruby-forum.com/t/problems-withe-the-template/166204)

<div class="topic-metadata">

**Author:** [@alex](https://www.ruby-forum.com/u/alex)\
**Replies:** 2\
**Last updated:** [April 22, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/problems-withe-the-template/166204 "2009-04-22T20:26:25Z")

</div>

Hello everybody ! I have in a view something like this : \<% unless (method\_name?(id)) then %\> \<%= link\_to h(t(:BTN)), new\_url\_path(id) %\> \<% else %\> \<%= link\_to\_function h(t(:BTN)), ‘return false;’ %\> \<% en…

---

## [How to get stacktrace for extending Ruby in C](https://www.ruby-forum.com/t/how-to-get-stacktrace-for-extending-ruby-in-c/166045)

<div class="topic-metadata">

**Author:** [@newb](https://www.ruby-forum.com/u/newb)\
**Replies:** 4\
**Last updated:** [April 22, 2009, 7:31pm UTC](https://www.ruby-forum.com/t/how-to-get-stacktrace-for-extending-ruby-in-c/166045 "2009-04-22T19:31:43Z")

</div>

Hi I extend ruby with C . i get error like segmentation fault when i call my client.rb how can i get the stacktrace ? Pls help me out Thanks

---

## [With RSpec 1.2.4, autospec runs twice](https://www.ruby-forum.com/t/with-rspec-1-2-4-autospec-runs-twice/166174)

<div class="topic-metadata">

**Author:** [@charlesgreen](https://www.ruby-forum.com/u/charlesgreen)\
**Replies:** 3\
**Last updated:** [April 22, 2009, 6:34pm UTC](https://www.ruby-forum.com/t/with-rspec-1-2-4-autospec-runs-twice/166174 "2009-04-22T18:34:37Z")

</div>

Hi, I created a ticket for this in Lighthouse ( https://rspec.lighthouseapp.com/projects/5645/tickets/797-with-rspec-124-autospec-runs-twice). However, I wanted to throw this out to the mailing list. Has anyone else …

---

## [Tests for my gem cannot find classes in gems lib directory](https://www.ruby-forum.com/t/tests-for-my-gem-cannot-find-classes-in-gems-lib-directory/166138)

<div class="topic-metadata">

**Author:** [@Anthony\_Broad-Crawf](https://www.ruby-forum.com/u/Anthony_Broad-Crawf)\
**Replies:** 1\
**Last updated:** [April 22, 2009, 9:45am UTC](https://www.ruby-forum.com/t/tests-for-my-gem-cannot-find-classes-in-gems-lib-directory/166138 "2009-04-22T09:45:58Z")

</div>

I am writing a gem and using RSpec to drive my development. However, whenever I describe a class within the gems lib I get an uninitialized constant error. I am placing my folder structure, spec.rake and first spec …

---

## [RSpec and Selenium automation of an application](https://www.ruby-forum.com/t/rspec-and-selenium-automation-of-an-application/166136)

<div class="topic-metadata">

**Author:** [@Saturn](https://www.ruby-forum.com/u/Saturn)\
**Replies:** 0\
**Last updated:** [April 22, 2009, 6:54am UTC](https://www.ruby-forum.com/t/rspec-and-selenium-automation-of-an-application/166136 "2009-04-22T06:54:25Z")

</div>

Hi All, I am new to rspec and I am using selenium with Rspec1.2.4, I have gone through describe, and it methods etc. I am automating an application which contains many testsuites and test methods. my question is …

---

## [Mocking: brittle specs and tight coupling?](https://www.ruby-forum.com/t/mocking-brittle-specs-and-tight-coupling/165312)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 13\
**Last updated:** [April 22, 2009, 6:14am UTC](https://www.ruby-forum.com/t/mocking-brittle-specs-and-tight-coupling/165312 "2009-04-22T06:14:41Z")

</div>

Hi, I’ve read of complaints that mocking can make the specs very brittle, in that if the method is changed at all, it will break the specs, even if the behavior remains the same. Do you find this to be the case? How …

---

## [\[cucumber, jruby, windows\] - What are you cucumber windows users using for ANSII color in your conso](https://www.ruby-forum.com/t/cucumber-jruby-windows-what-are-you-cucumber-windows-users-using-for-ansii-color-in-your-conso/166071)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 2\
**Last updated:** [April 22, 2009, 6:04am UTC](https://www.ruby-forum.com/t/cucumber-jruby-windows-what-are-you-cucumber-windows-users-using-for-ansii-color-in-your-conso/166071 "2009-04-22T06:04:09Z")

</div>

Not really a cucumber question, but I’m not seeing ansi colors on a Windows XP consoles. Some googling around says that windows consoles don’t support ansii color codes. If this is the case, what are you windows c…

---

## [How would I spec this? --Rails subscriptions](https://www.ruby-forum.com/t/how-would-i-spec-this-rails-subscriptions/166029)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 2\
**Last updated:** [April 21, 2009, 10:53am UTC](https://www.ruby-forum.com/t/how-would-i-spec-this-rails-subscriptions/166029 "2009-04-21T10:53:41Z")

</div>

I have a set of users And a set of things … podcasts Users should get a page that shows all of the podcassts with a check box If they are subscribed then the check box is checked Users table has first\_name, last\_name…

---

## [\[cucumber, jruby\] Same steps are being added multiple times?](https://www.ruby-forum.com/t/cucumber-jruby-same-steps-are-being-added-multiple-times/165996)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 1\
**Last updated:** [April 21, 2009, 6:23am UTC](https://www.ruby-forum.com/t/cucumber-jruby-same-steps-are-being-added-multiple-times/165996 "2009-04-21T06:23:20Z")

</div>

Aslak, I just ran the simple examples in your latest version of cucumber\_java, and it exposes the ambiguous steps problem that I’m seeing. Before I could get it to run, I had to make four changes to the cucumber-mav…

---

## [Re: \[cucumber, jruby\] Same steps are being added 	multiple times](https://www.ruby-forum.com/t/re-cucumber-jruby-same-steps-are-being-added-multiple-times/166028)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 0\
**Last updated:** [April 21, 2009, 6:13am UTC](https://www.ruby-forum.com/t/re-cucumber-jruby-same-steps-are-being-added-multiple-times/166028 "2009-04-21T06:13:57Z")

</div>

Aslak Hellesøy wrote: \> On Tue, Apr 14, 2009 at 12:08 AM, John G. removed\_email\_address@domain.invalid \> wrote: \> \>\> OK, I’ll reproduce in a simple example and create a ticket… \>\> \>\> \> Excellent - I’ll get to it …

---

## [Problem using cucumber with selenium](https://www.ruby-forum.com/t/problem-using-cucumber-with-selenium/166000)

<div class="topic-metadata">

**Author:** [@barunio](https://www.ruby-forum.com/u/barunio)\
**Replies:** 2\
**Last updated:** [April 20, 2009, 11:50pm UTC](https://www.ruby-forum.com/t/problem-using-cucumber-with-selenium/166000 "2009-04-20T23:50:12Z")

</div>

I’m trying to use Cucumber with Selenium to test my app. I have a method called “login\_as” defined as follows: def login\_as(user, password) visit new\_session\_path fill\_in “username”, :with =\> user.username fill\_i…

---

## [Cucmber: Mysql::Error: query: not connected: ROLLBACK](https://www.ruby-forum.com/t/cucmber-mysql-query-not-connected-rollback/165914)

<div class="topic-metadata">

**Author:** [@html-kurs](https://www.ruby-forum.com/u/html-kurs)\
**Replies:** 4\
**Last updated:** [April 20, 2009, 9:11pm UTC](https://www.ruby-forum.com/t/cucmber-mysql-query-not-connected-rollback/165914 "2009-04-20T21:11:48Z")

</div>

Hi, I ran in trouble with unexpected rollbacks using cucumber 0.3.0. My feature-file looks like Scenario: Create Valid Item Given I start and the step is Given /^I start$/ do get “/items” end In my log/test.log …

---

## [Appropriate adapter (Rails, Cucumber)](https://www.ruby-forum.com/t/appropriate-adapter-rails-cucumber/165957)

<div class="topic-metadata">

**Author:** [@juli](https://www.ruby-forum.com/u/juli)\
**Replies:** 1\
**Last updated:** [April 20, 2009, 11:55am UTC](https://www.ruby-forum.com/t/appropriate-adapter-rails-cucumber/165957 "2009-04-20T11:55:55Z")

</div>

Hi All, I’ve got a bunch of tests written in cucumber, and they’re all lovely… this is rails testing i’m doing by the way… and now I’m coming to testing the javascript and AJAX parts of the app… and I’ve decided to p…

---

## [\[cucumber, jruby\] Same steps are being added multiple times?](https://www.ruby-forum.com/t/cucumber-jruby-same-steps-are-being-added-multiple-times/165170)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 10\
**Last updated:** [April 20, 2009, 12:16am UTC](https://www.ruby-forum.com/t/cucumber-jruby-same-steps-are-being-added-multiple-times/165170 "2009-04-20T00:16:04Z")

</div>

Hi all, I’m not quite sure I understand how env.rb is loaded in the cucumber/jruby world. I have a directory structure like this: stories/fulfillment\_status\_tracking stories/fulfillment\_status\_tracking/main\_succes…

---

## [Autospec startup problem](https://www.ruby-forum.com/t/autospec-startup-problem/165906)

<div class="topic-metadata">

**Author:** [@ricklach](https://www.ruby-forum.com/u/ricklach)\
**Replies:** 8\
**Last updated:** [April 19, 2009, 11:14pm UTC](https://www.ruby-forum.com/t/autospec-startup-problem/165906 "2009-04-19T23:14:04Z")

</div>

Following the instructions in the beta Rspec book, /Rspec/mastermind 536 \> autospec /opt/RoR/bin/autotest:19:in load': Is a directory - /opt/RoR/lib/ruby/ gems/1.9.1/gems/cucumber-0.3.0/lib/autotest (Errno::EISDIR) fr…

---

## [Custom Example Groups](https://www.ruby-forum.com/t/custom-example-groups/165895)

<div class="topic-metadata">

**Author:** [@devbanana](https://www.ruby-forum.com/u/devbanana)\
**Replies:** 11\
**Last updated:** [April 19, 2009, 7:10pm UTC](https://www.ruby-forum.com/t/custom-example-groups/165895 "2009-04-19T19:10:49Z")

</div>

Hi, I want to build a custom example group, but there really aren’t any examples anywhere for how to do so. The new chapter in The RSpec Book talks about it, but doesn’t actually show an example, only how to registe…

---

## [How to approach testing automated processing](https://www.ruby-forum.com/t/how-to-approach-testing-automated-processing/165885)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [April 19, 2009, 2:07am UTC](https://www.ruby-forum.com/t/how-to-approach-testing-automated-processing/165885 "2009-04-19T02:07:20Z")

</div>

I have a requirement to fetch a data feed from our central bank and set a variety of currency exchange rates from that feed. My question is how does one approach behavioural driven design with autonomous automated pro…

---

## [DDL Rails 2.3 nested transactions causing problems in specs](https://www.ruby-forum.com/t/ddl-rails-2-3-nested-transactions-causing-problems-in-specs/165834)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 1\
**Last updated:** [April 19, 2009, 1:16am UTC](https://www.ruby-forum.com/t/ddl-rails-2-3-nested-transactions-causing-problems-in-specs/165834 "2009-04-19T01:16:48Z")

</div>

Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘RELEASE SAVEPOINT active\_record\_1’ at line 1: RELEASE SAVEPOINT ac…

---

## [Specs for attributes with default values on the SQL layer](https://www.ruby-forum.com/t/specs-for-attributes-with-default-values-on-the-sql-layer/165723)

<div class="topic-metadata">

**Author:** [@enduro](https://www.ruby-forum.com/u/enduro)\
**Replies:** 6\
**Last updated:** [April 18, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/specs-for-attributes-with-default-values-on-the-sql-layer/165723 "2009-04-18T22:45:21Z")

</div>

Hi I’m not sure what would be best practise to treat this case. Migration: t.boolean :fetched, :null =\> false, :default =\> false Model: validates\_inclusion\_of :fetched, :in =\> \[true, false\] Spec: it do article = …

---

## [But rspec can not be found](https://www.ruby-forum.com/t/but-rspec-can-not-be-found/165777)

<div class="topic-metadata">

**Author:** [@tomx](https://www.ruby-forum.com/u/tomx)\
**Replies:** 8\
**Last updated:** [April 18, 2009, 6:12am UTC](https://www.ruby-forum.com/t/but-rspec-can-not-be-found/165777 "2009-04-18T06:12:12Z")

</div>

Hi, I’ve been seeing the below problem since RSpec 1.2.1 on any machine that doesn’t have the RSpec gems installed. 1.2.0 was fine. I’d hoping it would magically go away with later versions but it hasn’t; does anyone…

---

## [AfterCurrentScenario block](https://www.ruby-forum.com/t/aftercurrentscenario-block/165807)

<div class="topic-metadata">

**Author:** [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Replies:** 6\
**Last updated:** [April 17, 2009, 7:01pm UTC](https://www.ruby-forum.com/t/aftercurrentscenario-block/165807 "2009-04-17T19:01:54Z")

</div>

Is there currently a way to register a block to run after the current scenario completes? If not, we’ve implemented one. Would anyone be interested in us submitting it as a patch to Cucumber? Something like Given “s…

---

## [(MissingSourceFile) no such file to load -- spec/expectations/differs/default](https://www.ruby-forum.com/t/missingsourcefile-no-such-file-to-load-spec-expectations-differs-default/165473)

<div class="topic-metadata">

**Author:** [@aap](https://www.ruby-forum.com/u/aap)\
**Replies:** 5\
**Last updated:** [April 16, 2009, 8:56pm UTC](https://www.ruby-forum.com/t/missingsourcefile-no-such-file-to-load-spec-expectations-differs-default/165473 "2009-04-16T20:56:10Z")

</div>

Hi All, This morning I did a “gem update” which installed “rspec-1.2.4” and when I run my cucumber “rake features” command I got the following: c:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:142:in activate': can't acti…

---

## [Best practice for model callbacks?](https://www.ruby-forum.com/t/best-practice-for-model-callbacks/165721)

<div class="topic-metadata">

**Author:** [@barunio](https://www.ruby-forum.com/u/barunio)\
**Replies:** 5\
**Last updated:** [April 16, 2009, 8:40pm UTC](https://www.ruby-forum.com/t/best-practice-for-model-callbacks/165721 "2009-04-16T20:40:13Z")

</div>

In many of my models, I have callback methods like this: class MyModel \< ActiveRecord::Base before\_save :do\_something def do\_something some code here… end end The do\_something method is a public method that is s…

---

## [Timeout Errors- Rails 2.3.2 and Restful Authentication](https://www.ruby-forum.com/t/timeout-errors-rails-2-3-2-and-restful-authentication/165730)

<div class="topic-metadata">

**Author:** [@Nicholas\_Van\_W](https://www.ruby-forum.com/u/Nicholas_Van_W)\
**Replies:** 0\
**Last updated:** [April 16, 2009, 8:34pm UTC](https://www.ruby-forum.com/t/timeout-errors-rails-2-3-2-and-restful-authentication/165730 "2009-04-16T20:34:55Z")

</div>

Maybe I’m missing something…I’ve started getting timeout errors due to “perform\_delivery\_smtp”. I’ve checked environment.rb and test.rb, and they look fine. Any ideas why these tests are trying to send actual messages …

---

## [\`add\_example\_group': undefined method \`deprecate' for Spec:Module (NoMethodError)](https://www.ruby-forum.com/t/add-example-group-undefined-method-deprecate-for-spec-module-nomethoderror/165652)

<div class="topic-metadata">

**Author:** [@vanweerd](https://www.ruby-forum.com/u/vanweerd)\
**Replies:** 2\
**Last updated:** [April 16, 2009, 8:20pm UTC](https://www.ruby-forum.com/t/add-example-group-undefined-method-deprecate-for-spec-module-nomethoderror/165652 "2009-04-16T20:20:13Z")

</div>

I’m the getting the following error when running rspec on a rails project. /Users/vanweerd/work2/innerplate/vendor/plugins/rspec/lib/spec/runner/ formatter/base\_formatter.rb:52:in add\_example\_group': undefined methodd…

---

## [Testing discovered a problem in my code](https://www.ruby-forum.com/t/testing-discovered-a-problem-in-my-code/165691)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 12\
**Last updated:** [April 16, 2009, 8:17pm UTC](https://www.ruby-forum.com/t/testing-discovered-a-problem-in-my-code/165691 "2009-04-16T20:17:16Z")

</div>

When trying to test using sqlite in-memory in ran into a problem: rake test raises an error on a test running the failing test alone works perfectly. So what’s the problem? here is the method giving the trouble: def …

---

## [\[RSpec\] rcov and/or rexml bug?](https://www.ruby-forum.com/t/rspec-rcov-and-or-rexml-bug/159270)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 13\
**Last updated:** [April 16, 2009, 4:30pm UTC](https://www.ruby-forum.com/t/rspec-rcov-and-or-rexml-bug/159270 "2009-04-16T16:30:57Z")

</div>

Hi, Running: Ruby 1.8.7 p72, RSpec 1.1.12 and rcov 0.8.1.2.0, I get the following error message with $ rake spec:rcov – /usr/local/ruby1.8.7//lib/ruby/1.8/rexml/formatters/pretty.rb:131:in \[\]': no implicit conversio…

---

## [Rate my code: refactoring from spec](https://www.ruby-forum.com/t/rate-my-code-refactoring-from-spec/165616)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 6\
**Last updated:** [April 16, 2009, 12:24pm UTC](https://www.ruby-forum.com/t/rate-my-code-refactoring-from-spec/165616 "2009-04-16T12:24:18Z")

</div>

Hi, I used to have the following method: def Paypal.process\_ipn(params) … paypal = create!(params) paypal.order.update\_from\_ipn(completed?) end That method obviously is not easily specable because of the double do…

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

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