# What command to run all stories?

**URL:** <https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309>\
**Category:** RSpec\
**Created:** [November 15, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309 "2007-11-15T17:57:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [November 15, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309/1 "2007-11-15T17:57:19Z")

</div>

Hi, I’ve been following this thread and I can get the example stories  
to run with the ruby command. But I’ve been unable to get the example  
from  
[http://blog.davidchelimsky.net/articles/2007/10/25/plain-text-stories-part-iii](http://blog.davidchelimsky.net/articles/2007/10/25/plain-text-stories-part-iii)  
to run with all.rb

ruby stories/all.rb  
/home/edh/story/stories/additions/steps/addition\_steps.rb:2: undefined  
method `steps_for' for main:Object (NoMethodError) from /home/edh/story/stories/all.rb:3:in `require’  
from /home/edh/story/stories/all.rb:3  
from /home/edh/story/stories/all.rb:2:in `each' from /home/edh/story/stories/all.rb:2 from stories/all.rb:3:in `require’  
from stories/all.rb:3  
from stories/all.rb:2:in `each’  
from stories/all.rb:2

The examples seem older than the version on David’s blog. Am I missing  
some parts from David’s blog?

My directory looks like:  
stories/  
|-- additions  
| |-- adder.rb  
| |-- addition  
| |-- addition.rb  
| `-- steps | `– addition\_steps.rb  
|-- all.rb  
`-- helper.rb

If I run the story stand-alone, I get:  
ruby stories/additions/addition.rb  
Running 2 scenarios:

Story: simple addition

As an accountant  
I want to add numbers  
So that I can count beans

Scenario: add one plus one

Given an addend of 1 (PENDING)  
And an addend of 1 (PENDING)

When the addends are added (PENDING)

Then the sum should be 2 (PENDING)  
And the corks should be  
popped/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/errors.rb:94:in  
`check': SQL logic error or missing database (SQLite3::SQLException) from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:76:in `check’  
from  
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:68:in  
`commence' from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:61:in `initialize’  
from  
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/statement.rb:163:in  
`new' from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/statement.rb:163:in `execute’  
from  
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:212:in  
`execute' from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:187:in `prepare’  
from  
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:211:in  
`execute' ... 13 levels... from /home/edh/story/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb:39:in `each’  
from  
/home/edh/story/vendor/plugins/rspec/lib/spec/story/runner/story\_runner.rb:39:in  
`run_stories' from /home/edh/story/vendor/plugins/rspec/lib/spec/story/runner.rb:41:in `register\_exit\_hook’  
from stories/additions/addition.rb:3  
This last part is happening in the at\_exit part of Test:Unit

Also, I don’t understand why the scenario’s are pending.

Thanks  
Ed

–  
Ed Howland

> **[Green Programming](http://greenprogrammer.blogspot.com)**
>
> Environmentally safe code

“The information transmitted is intended only for the person or entity  
to which it is addressed and may contain proprietary, confidential  
and/or legally privileged material. Any review, retransmission,  
dissemination or other use of, or taking of any action in reliance  
upon, this information by persons or entities other than the intended  
recipient is prohibited. If you received this in error, please contact  
the sender and delete the material from all computers.”

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [November 15, 2007, 7:20pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309/2 "2007-11-15T19:20:40Z")

</div>

When I copied the addition example into my test rails app, things  
worked… The “popping the cork” was the only pending action, and  
was expected. I’ve only be able to run via ruby as well.

Eric

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [November 15, 2007, 7:27pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309/3 "2007-11-15T19:27:07Z")

</div>

Yeah, I got the stand-alone story to work. The trick was to mv  
stories/additions/steps to stories/steps. My stories/helper.rb  
looks like this:

ENV[“RAILS\_ENV”] = “test”  
require File.expand\_path(File.dirname( **FILE** ) +  
“/…/config/environment”)  
require ‘spec/rails/story\_adapter’  
Dir[File.join(File.dirname( **FILE** ), “steps/\*.rb”)].each do |file|  
require file  
end

I personally think that steps should be isolated from other stories.  
This seems to requre all steps in every story.

all.rb is still giving me the same error.

Ed

On Nov 15, 2007 12:19 PM, Eric P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > ```
> > from /home/edh/story/stories/all.rb:3:in `require'
> > 
> > ```
> > 
> > Scenario: add one plus one  
> > `check’: SQL logic error or missing database (SQLite3::SQLException)  
> > lib/sqlite3/statement.rb:163:in  
> > from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/  
> > runner.rb:41:in
> > 
> > * * *
> 
> * * *
> 
> rspec-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://rubyforge.org/mailman/listinfo/rspec-users](http://rubyforge.org/mailman/listinfo/rspec-users)

–  
Ed Howland

> **[Green Programming](http://greenprogrammer.blogspot.com)**
>
> Environmentally safe code

“The information transmitted is intended only for the person or entity  
to which it is addressed and may contain proprietary, confidential  
and/or legally privileged material. Any review, retransmission,  
dissemination or other use of, or taking of any action in reliance  
upon, this information by persons or entities other than the intended  
recipient is prohibited. If you received this in error, please contact  
the sender and delete the material from all computers.”

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [November 15, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309/4 "2007-11-15T20:09:17Z")

</div>

On Nov 15, 2007 12:30 PM, David C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It requires them all but doesn’t expose them all in your story. Agreed  
> that each story should be limited in what it sees.

David,

Thanks for the info. Any directions you can point me to make :

ruby stories/all.rb

work? I think I am missing some require there. It is the stock one from  
trunk.

Thanks  
Ed

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [November 18, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309/5 "2007-11-18T16:22:44Z")

</div>

On Nov 15, 2007 1:00 PM, Ed Howland [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > It requires them all but doesn’t expose them all in your story. Agreed  
> > that each story should be limited in what it sees.
> 
> David,
> 
> Thanks for the info. Any directions you can point me to make :
> 
> ruby stories/all.rb
> 
> work? I think I am missing some require there. It is the stock one from trunk.

The one that gets generated by script/generate rspec should just work.  
It requires every ruby file in the stories directory and any of its  
subdirectories. As long as each file is also doing the requiring that  
it needs (i.e. each file that runs specific stories requires  
stories/helper.rb and helper.rb requires all the step definitions) you  
should be fine.

David

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [November 15, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/what-command-to-run-all-stories/120309/6 "2007-11-15T19:30:37Z")

</div>

On Nov 15, 2007 12:26 PM, Ed Howland [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I personally think that steps should be isolated from other stories.  
> This seems to requre all steps in every story.

It requires them all but doesn’t expose them all in your story. Agreed  
that each story should be limited in what it sees.
