I’m just getting started with rspec, I’m running on edge for both. In
a fresh project, I freeze edge, install the edge rspec plugin. I
generate a simple rspec_model and run the spec. It passes. When I
run rake spec:doc, I get the following output: - NO NAME (Because of
–dry-run) where the specification should be. In fact if I just make
a pending spec, it does the same.
I’ve tracked it down to something in ‘spec/rails’ because if I comment
that out and add the class declaration directly in the spec file it
works as it’s supposed to.
Has anyone seen this behavior before?
Josh
On 10/6/07, Joshua S. [email protected] wrote:
Has anyone seen this behavior before?
There is an auto-generation feature that let’s you do this:
specify { something.should be_something }
which would produce output:
The thing is that it relies on actually running the examples, which
spec:doc does not do.
If you’re trying to run the specs so they produce the specdoc output, do
this:
script/spec spec -fs
That will run the examples and produce the output.
Cheers,
David
On Oct 6, 2007, at 10:21 AM, David C. wrote:
comment
That will run the examples and produce the output.
Cheers,
David
Somewhat off topic, but I ran into this the other day when I was
trying to override that rake task to create the specdoc in text &
html. Just wondering - how would I override that rake task? I’ve
seen this before:
Task::TASKS[“spec:doc”] = nil
But it no longer seems to work with newer versions of rake (i.e. the
ones which have namespaces)
Scott
On Sat, 06 Oct 2007 09:21:34 -0500, David C. wrote:
If you’re trying to run the specs so they produce the specdoc output, do this:
script/spec spec -fs
That will run the examples and produce the output.
I’m running rspec and rspec_on_rails trunk(r2717), and am getting this,
except my “its” have string descriptions. One of my “describes” looks
like
this:
describe ‘Person trying to logon’ do
fixtures :users
it ‘with an invalid username should fail’ do
User.logon(‘harry’, ‘123456’).should be_nil
end
it ‘with an invalid password should fail’ do
User.logon(users(:admin).username, ‘’).should be_nil
end
end
If I’m understanding you correctly, since I have the strings, with
spec:doc
I should get output similar to:
Person trying to logon
- with an invalid username should fail
- with an invalid password should fail
But I’m just getting:
Person trying to logon
- NO NAME (Because of --dry-run)
- NO NAME (Because of --dry-run)
Further, I tried the script/spec -fs line mentioned, and get a rake
failure complaining of too few args:
script/spec spec -fs
script/spec:4:in `run’: wrong number of arguments (5 for 1)
(ArgumentError)
from script/spec:4
Thanks,
Steve
On Oct 13, 2007, at 9:59 PM, Steve wrote:
The thing is that it relies on actually running the examples, which
this,
- with an invalid username should fail
script/spec spec -fs
script/spec:4:in `run’: wrong number of arguments (5 for 1)
(ArgumentError)
from script/spec:4
Try svn up, and rerunning script/generate rspec. This should solve
the second problem (unless this is a bug, again).
Scott