# RSpec

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

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

---

## [Re: Role of stories vs specs, revisited](https://www.ruby-forum.com/t/re-role-of-stories-vs-specs-revisited/125807)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 3\
**Last updated:** [January 13, 2008, 1:33am UTC](https://www.ruby-forum.com/t/re-role-of-stories-vs-specs-revisited/125807 "2008-01-13T01:33:30Z")

</div>

If you were to rename deposit to credit, and withdraw to debit I’m more concerned with adding a parameter or changing the default value of a parameter. My fear is that given enough time and size there will be a fair…

---

## [Varying test data](https://www.ruby-forum.com/t/varying-test-data/125710)

<div class="topic-metadata">

**Author:** [@Kerry\_B](https://www.ruby-forum.com/u/Kerry_B)\
**Replies:** 8\
**Last updated:** [January 12, 2008, 10:56am UTC](https://www.ruby-forum.com/t/varying-test-data/125710 "2008-01-12T10:56:57Z")

</div>

This isn’t specific to RSpec, but is hopefully on-topic for this list. I like (especially when “ping pong pairing”) to write a spec, then write the smallest amount of code I can to pass it (especially when “ping pong …

---

## [Re: Role of stories vs specs, revisited](https://www.ruby-forum.com/t/re-role-of-stories-vs-specs-revisited/125795)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 1\
**Last updated:** [January 12, 2008, 4:34am UTC](https://www.ruby-forum.com/t/re-role-of-stories-vs-specs-revisited/125795 "2008-01-12T04:34:40Z")

</div>

The thing is that, ideally, you don’t want to have to make changes to the tests for object A when you’re refactoring B. WDYT? Yeah, I buy that. Not everyone does though. Or at least not everyone feels that it’…

---

## [Role of stories vs specs, revisited](https://www.ruby-forum.com/t/role-of-stories-vs-specs-revisited/125773)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 4\
**Last updated:** [January 11, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/role-of-stories-vs-specs-revisited/125773 "2008-01-11T22:48:53Z")

</div>

A couple months ago I asked how stories and specs might impact each other. \[1\] If you look at Dan N.'s example of what’s in a story \[2\], and you imagine using the spec framework to drive the design, you can probabl…

---

## [Missing methods](https://www.ruby-forum.com/t/missing-methods/125667)

<div class="topic-metadata">

**Author:** [@jimdeuc](https://www.ruby-forum.com/u/jimdeuc)\
**Replies:** 5\
**Last updated:** [January 11, 2008, 10:41pm UTC](https://www.ruby-forum.com/t/missing-methods/125667 "2008-01-11T22:41:15Z")

</div>

We have a custom implementation of the Mother Object idea. It’s inside of a module, basically like this: module Factory %w(account friendship person invitation message asset email\_address birth).each do |klass| eval…

---

## [Specs on private methods](https://www.ruby-forum.com/t/specs-on-private-methods/125386)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 40\
**Last updated:** [January 11, 2008, 7:46pm UTC](https://www.ruby-forum.com/t/specs-on-private-methods/125386 "2008-01-11T19:46:33Z")

</div>

How does a person test private methods? Is there a way to declare them as private, but retain any tests that were written during the initial development? Thanks.

---

## [Changes in rspec's trunk and autotest](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 5\
**Last updated:** [January 11, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682 "2008-01-11T16:56:57Z")

</div>

This applies to anyone using rspec’s trunk from \>= 3220 with ZenTest \<= 3.7.2. Anyone else, feel free to move on… The next release of ZenTest, coming soon, includes some changes that improve the relationship between …

---

## [Guide to good mocking?](https://www.ruby-forum.com/t/guide-to-good-mocking/125666)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 2\
**Last updated:** [January 11, 2008, 4:30am UTC](https://www.ruby-forum.com/t/guide-to-good-mocking/125666 "2008-01-11T04:30:50Z")

</div>

Hi all - does anyone know of a good blog post or wiki or something with a good guide to mocking? I’ve got some degree of responsibility for people who are creating mocks. I’m supposed to actually be telling them the b…

---

## [Shoulda](https://www.ruby-forum.com/t/shoulda/125651)

<div class="topic-metadata">

**Author:** [@confundido](https://www.ruby-forum.com/u/confundido)\
**Replies:** 21\
**Last updated:** [January 11, 2008, 2:20am UTC](https://www.ruby-forum.com/t/shoulda/125651 "2008-01-11T02:20:27Z")

</div>

Hey, we’re currently using shoulda (http://dev.thoughtbot.com/ shoulda/) on a project and I saw some things that would be really nice to see in rspec, namely the should\_ methods, and especially the should\_be\_restful m…

---

## [Peepcode RSpec User Stories](https://www.ruby-forum.com/t/peepcode-rspec-user-stories/125661)

<div class="topic-metadata">

**Author:** [@codejoy](https://www.ruby-forum.com/u/codejoy)\
**Replies:** 0\
**Last updated:** [January 11, 2008, 1:08am UTC](https://www.ruby-forum.com/t/peepcode-rspec-user-stories/125661 "2008-01-11T01:08:29Z")

</div>

http://peepcode.com/products/rspec-user-stories Shane M. ELC Technologies ™ 1921 State Street Santa Barbara, CA 93101 Phone: +64 4 568 6684 Mobile: +64 21 435 586 Email: removed\_email\_address@domain.invalid AIM:…

---

## [Specs on private methods](https://www.ruby-forum.com/t/specs-on-private-methods/125636)

<div class="topic-metadata">

**Author:** [@barsalou](https://www.ruby-forum.com/u/barsalou)\
**Replies:** 6\
**Last updated:** [January 10, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/specs-on-private-methods/125636 "2008-01-10T21:41:57Z")

</div>

It’s interesting that this thread has started because I just ran into this problem. The error I got was: NoMethodError in ‘Signup she be a valid mac address’ protected method \`normalize\_mac’ called for #Signup:0x408c…

---

## [Mocking and stubbing Rails' association extensions](https://www.ruby-forum.com/t/mocking-and-stubbing-rails-association-extensions/125631)

<div class="topic-metadata">

**Author:** [@kampers](https://www.ruby-forum.com/u/kampers)\
**Replies:** 4\
**Last updated:** [January 10, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/mocking-and-stubbing-rails-association-extensions/125631 "2008-01-10T20:39:06Z")

</div>

I’m having a lot of trouble stubbing out an association extension for some view tests. Example rails code modeling a music album: class Album \< ActiveRecord::Base has\_many :songs do def streamable find(:all, :condit…

---

## [Problems with rspec 1.1 required inside rake tasks](https://www.ruby-forum.com/t/problems-with-rspec-1-1-required-inside-rake-tasks/125369)

<div class="topic-metadata">

**Author:** [@lodestone](https://www.ruby-forum.com/u/lodestone)\
**Replies:** 2\
**Last updated:** [January 8, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/problems-with-rspec-1-1-required-inside-rake-tasks/125369 "2008-01-08T20:03:36Z")

</div>

This is interesting. The default rspec rake tasks generated by Hoe give you an rspec.rake file that looks like: begin require ‘spec’ rescue LoadError require ‘rubygems’ require ‘spec’ end So far so good. When…

---

## [Status/exit code for story runner](https://www.ruby-forum.com/t/status-exit-code-for-story-runner/125078)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 1\
**Last updated:** [January 5, 2008, 10:32am UTC](https://www.ruby-forum.com/t/status-exit-code-for-story-runner/125078 "2008-01-05T10:32:30Z")

</div>

Hi All, I’m trying to incorporate our stories into our build for our cruisecrontrol.rb projects and it looks like the Story Runner always returns a 0 (zero) no matter if the tests pass or fail. This is in contrast to…

---

## [Best way to modify spec (the command-line tool)?](https://www.ruby-forum.com/t/best-way-to-modify-spec-the-command-line-tool/125019)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 7\
**Last updated:** [January 4, 2008, 8:50pm UTC](https://www.ruby-forum.com/t/best-way-to-modify-spec-the-command-line-tool/125019 "2008-01-04T20:50:59Z")

</div>

Hi all, where I work we’ve cooked up a kind of ghetto profiler for our specs. It basically just does this: time = Time.now run the spec puts “woah! dude. long spec.” if time \> 1.second I’m simplifying here. I think …

---

## [Patch for html display](https://www.ruby-forum.com/t/patch-for-html-display/124972)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 1\
**Last updated:** [January 4, 2008, 10:38am UTC](https://www.ruby-forum.com/t/patch-for-html-display/124972 "2008-01-04T10:38:12Z")

</div>

All, I’ve found that the html view for the rspec formatter falls to pieces with Rails 2.02 and rspec 1.10. Has anyone else run into this trouble? Here’s a monkey patch that fixes the problem. A more elegant fix wou…

---

## [\[ANN\] RSpec-1.1.0 is released](https://www.ruby-forum.com/t/ann-rspec-1-1-0-is-released/123126)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 15\
**Last updated:** [January 3, 2008, 7:19pm UTC](https://www.ruby-forum.com/t/ann-rspec-1-1-0-is-released/123126 "2008-01-03T19:19:00Z")

</div>

The RSpec Development Team is pleased as glug (that’s kind of like punch, but more festive) to announce RSpec-1.1.0. Thanks to all who have contributed patches over the last few months. Big thanks to Dan N. and Brian …

---

## [Do you think it would look cleaner?](https://www.ruby-forum.com/t/do-you-think-it-would-look-cleaner/124503)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 15\
**Last updated:** [January 3, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/do-you-think-it-would-look-cleaner/124503 "2008-01-03T18:50:07Z")

</div>

I was looking over some of my specs. I was thinking that the following: @game.should\_receive(:name).and\_return(‘The Battle for Blaze’) @game.should\_receive(:people).and\_return(5000000) @game.should\_receive(:activated…

---

## [./script/story command](https://www.ruby-forum.com/t/script-story-command/124518)

<div class="topic-metadata">

**Author:** [@bryan123](https://www.ruby-forum.com/u/bryan123)\
**Replies:** 5\
**Last updated:** [January 3, 2008, 6:45am UTC](https://www.ruby-forum.com/t/script-story-command/124518 "2008-01-03T06:45:44Z")

</div>

Below I’ve pasted a ./script/story command I’ve been using for about a week. It has three modes of operation: ./script/story with no arguments will run all \*.story files in the story path ./script/story with a path o…

---

## [Mocks? Really?](https://www.ruby-forum.com/t/mocks-really/122329)

<div class="topic-metadata">

**Author:** [@nctodc](https://www.ruby-forum.com/u/nctodc)\
**Replies:** 42\
**Last updated:** [January 1, 2008, 11:49pm UTC](https://www.ruby-forum.com/t/mocks-really/122329 "2008-01-01T23:49:35Z")

</div>

OK, so i’ve played a bit with mocks and mock\_models in controller and view tests and i have a question. Is this statement really correct: “We highly recommend that you exploit the mock framework here rather than provi…

---

## [How to run stories with \`spec' command?](https://www.ruby-forum.com/t/how-to-run-stories-with-spec-command/124636)

<div class="topic-metadata">

**Author:** [@Chiyuan\_Z](https://www.ruby-forum.com/u/Chiyuan_Z)\
**Replies:** 4\
**Last updated:** [January 1, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/how-to-run-stories-with-spec-command/124636 "2008-01-01T16:43:03Z")

</div>

Hi, all! I have a story steps array.rb and the story array.story. I can run it with ruby array.rb But when I execute spec array.rb nothing happened. I’m wondering how can I use spec command to execute stories? (ex…

---

## [Executing code after each step of a story](https://www.ruby-forum.com/t/executing-code-after-each-step-of-a-story/124237)

<div class="topic-metadata">

**Author:** [@Armin\_J](https://www.ruby-forum.com/u/Armin_J)\
**Replies:** 3\
**Last updated:** [January 1, 2008, 1:42pm UTC](https://www.ruby-forum.com/t/executing-code-after-each-step-of-a-story/124237 "2008-01-01T13:42:50Z")

</div>

Hello, how can I execute some code after each step of a story. Is there some kind of listener documentated. Thank you in advance, Armin

---

## [Should send\_email always succeeds?](https://www.ruby-forum.com/t/should-send-email-always-succeeds/124536)

<div class="topic-metadata">

**Author:** [@cwd](https://www.ruby-forum.com/u/cwd)\
**Replies:** 0\
**Last updated:** [December 30, 2007, 12:06am UTC](https://www.ruby-forum.com/t/should-send-email-always-succeeds/124536 "2007-12-30T00:06:56Z")

</div>

I wrote the following in my spec: emails = ActionMailer::Base.deliveries emails.length.should eql(2) response.should send\_email { with\_tag('tr', @contact\_info\[:full\_name\]) } knowing that 1) an email is being se…

---

## [Converting to Rails 2.0.2](https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469)

<div class="topic-metadata">

**Author:** [@cwd](https://www.ruby-forum.com/u/cwd)\
**Replies:** 3\
**Last updated:** [December 29, 2007, 11:19am UTC](https://www.ruby-forum.com/t/converting-to-rails-2-0-2/124469 "2007-12-29T11:19:36Z")

</div>

I’m moving an older project to Rails 2.0.2 and ran into a roadblock on the version matching. Here’s script/console session: Spec::VERSION::REV =\> “1785” Spec::Rails::VERSION::REV NoMethodError: undefined method r…

---

## [JtestR 0.1 released](https://www.ruby-forum.com/t/jtestr-0-1-released/124463)

<div class="topic-metadata">

**Author:** [@Ola\_B](https://www.ruby-forum.com/u/Ola_B)\
**Replies:** 1\
**Last updated:** [December 29, 2007, 1:37am UTC](https://www.ruby-forum.com/t/jtestr-0-1-released/124463 "2007-12-29T01:37:11Z")

</div>

JtestR allows you to test your Java code with Ruby frameworks. Homepage: http://jtestr.codehaus.org Download: http://dist.codehaus.org/jtestr JtestR 0.1 is the first public release of the JtestR testing tool. JtestR …

---

## [Rspec\_autotest testing with the use of the controller Namespaces](https://www.ruby-forum.com/t/rspec-autotest-testing-with-the-use-of-the-controller-namespaces/124437)

<div class="topic-metadata">

**Author:** [@raecoo](https://www.ruby-forum.com/u/raecoo)\
**Replies:** 0\
**Last updated:** [December 28, 2007, 5:37pm UTC](https://www.ruby-forum.com/t/rspec-autotest-testing-with-the-use-of-the-controller-namespaces/124437 "2007-12-28T17:37:00Z")

</div>

Rails2.0 the official support of namespace, making it easier for people with the usual habit of definition Controller For example,We define the following Controller admin/hacks\_controller this class namespace is Adm…

---

## [ExampleGroup and SharedExampleGroup relationship(?)](https://www.ruby-forum.com/t/examplegroup-and-sharedexamplegroup-relationship/124320)

<div class="topic-metadata">

**Author:** [@visage](https://www.ruby-forum.com/u/visage)\
**Replies:** 5\
**Last updated:** [December 27, 2007, 6:50pm UTC](https://www.ruby-forum.com/t/examplegroup-and-sharedexamplegroup-relationship/124320 "2007-12-27T18:50:53Z")

</div>

I’m working on a series going over the source code for rspec, and I ran into something interesting with ExampleGroup and SharedExampleGroup. I was wondering if anyone could shed light on it. \[NOTE: I’m working throug…

---

## [Story runner rake task](https://www.ruby-forum.com/t/story-runner-rake-task/123726)

<div class="topic-metadata">

**Author:** [@jimdeuc](https://www.ruby-forum.com/u/jimdeuc)\
**Replies:** 19\
**Last updated:** [December 26, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/story-runner-rake-task/123726 "2007-12-26T22:51:45Z")

</div>

What’s the status on a rake task for the story runner. If nothing is in progress, where could I start to try and build one? JD

---

## [Re: Mocks? Really?](https://www.ruby-forum.com/t/re-mocks-really/124230)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 0\
**Last updated:** [December 26, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/re-mocks-really/124230 "2007-12-26T19:45:57Z")

</div>

My first email sounded more certain that I intended. I’m trying to work out my own views by throwing out ideas in a peer review fashion. The integration test will die if you broke functionality. I’m curious what…

---

## [How-to spec this helper method?](https://www.ruby-forum.com/t/how-to-spec-this-helper-method/123757)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 3\
**Last updated:** [December 24, 2007, 4:26pm UTC](https://www.ruby-forum.com/t/how-to-spec-this-helper-method/123757 "2007-12-24T16:26:20Z")

</div>

Hey gang, I have this dead-simple method defined in a helper: def add\_category\_link(name) link\_to\_function name do |page| page.insert\_html :bottom, :categories, :partial =\> ‘category’, :object =\> Category.new end …

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

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