First try using RSpec on a simple Rails 2.0 app

Hi,

I’ve got a Rails 2.0 app “AIMS_1” with one model, “Portfolio”. (I’m
following David Chelimsky’s 2007 tutorial at
http://blog.davidchelimsky.net/articles/2007/05/14/an-introduction-to-rspec-part-i).
Portfolio has two attributes: :symbol and :name.

With great help from this NG, I’ve got a neat set of validations
for :symbol.

I want to put together a script that will test the validations as part
of a suite of tests to confirm the app’s validity as I expand it. For
this purpose, I added a Q&A directory (actually, “__QA”) under AIMS_1
and populated it with the following portfolio_spec.rb file:

# portfolio_spec.rb
# K:\_Projects\Ruby\_Rails_Apps\AIMS_1\__QA

require 'rubygems'
require 'spec'
require 'spec/story'
require 'K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.0.2/lib/ActiveRecord'
require '../app/models/portfolio'

describe Portfolio do
end

When I run “spec portfolio_spec.rb” in a Command window I get a nil/
nothing/nada return, in contrast to David’s return:

Finished in 6.0e-06 seconds

0 examples, 0 failures

However, I edit portfolio_spec.rb in SciTE, and this IDE knows how
to run programs, so I get the expected result:

Finished in 0.0930000000000001 seconds

0 examples, 0 failures

That’s surprising, since SciTE issued the command “ruby
portfolio_spec.rb” rather than Dave’s “spec portfolio_spec.rb”.

I’m running ruby 1.8.6, Rails 2.0.2 and SciTE 1.74 over WinXP/SP2.

Any ideas?

Thanks in Advance,
Richard

False alarm. I got it working. I don't know what I did, but I'm
just going to carry on until the next conundrum wrapped in a riddle
surfaces.

With apologies & best wishes,
Richard