Hello all.
I believe I was under the impression that with rspec 2, one didn't
need to require 'autorun' to have specs autorun.
Can anybody tell me if this is the case or not?
Thanks!
-roger-
___
rspec-users mailing list
rspec-users@rubyforge.org
http://ru
Sorry if this is a newbie question, but here goes.
I was wondering if the following is somehow possible:
for file in Dir['*.bmp']
it "should be able to parse #{file}" do
p file
# test this file
end
end
Currently rspec seems to evaluate the blocks after the fact, leading
Got this:
no such file to load -- spec/rake/spectask
anybody know off hand what the equivalent is for rspec2?
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
> > it "should pass again" do
> > context "a::b" do
>
> You can't wrap contexts inside examples.
Cool thanks for the reply.
The confusing part is that it allowed me to have that context within
an example.
Maybe a more explicit failure for newbies when they do this would be
kind.
-r
__
> My understanding is eventmachined is normally run within Thin, and it
> is Thin who initiates the event loop.
>
> So how do you test the eventmachined rails app? Do we have to modify
> the rspec script to initiate the event loop?
You could also use
before(:all) do
EM.start_in_other_thread
end
Hi all. Noticed that with rspec 1.x
methods at "higher levels" aren't available in lower, ex:
context "a" do
def go
end
it "should pass" do
go
end
it "should pass again" do
context "a::b" do
go
end
end
end
This surprised me a bit, making re-use of outer methods unavail
Hi all.
Saw this:
Usage: rspec [options] [files or directories]
-b, --backtrace Enable full backtrace
-c, --[no-]color, --[no-]colour Enable color in the output
-d, --debug Enable debugging
-e, --example PATTERNRun examples whose
Would it be possible to have pending be accessible everywhere?
Curgem rently with
describe '' do
pending 'abc' do
end
end
yields:
C:\dev\ruby\universal-scene-skipper\spec>spec small.spec
C:/dev/ruby/universal-scene-skipper/spec/small.spec:3: undefined
method `pending' for Spec::Example::Examp
> > Failure/Error: Unable to find matching line from backtrace
> > Perhaps it isn't quite windows friendly?
>
> That happens now and then when the error is in code generated with
> eval(string) with no file and ref numbers. Has nothing to do with Windows as
> far as I know, and is the same pr
> > The skinny of this request is that I'd find it more useful to actually
> > have the code displayed that failed on line 14, in this case, the word
> > "fail"
...
> Already done in rspec-2. Likely won't backport it to rspec-1 for some time
> (if ever).
Nice. Looks like rspec-2 will fit the bill
Hi all.
Sorry if this is an old request...
Currently when a failure is reported it looks like this:
C:\dev\ruby\faster_rubygems\spec>spec
spec.faster_rubygems_cacheing.rb
F
1)
RuntimeError in 'FasterRubyGems cacheing Gem.bin_path should cache and
reload Gem.bin_path where possible'
assertion fai
>
> I think a TOC would be far easier to maintain, no?
I think so. I'll create one sometime.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
The wiki (especially the index on its right hand)
http://wiki.github.com/dchelimsky/rspec/
currently (to me) feels a bit hard to navigate.
Given that my one request to github to allow for orderable right hand
index was denied, I was wondering if some work wants to be done on it
to make it easier
> Be explicit about the error you expect to get:
>
> lambda { ... }.should raise_error(SomeErrorClass, /match the message/)
>
> Read the documentation
> athttp://rspec.rubyforge.org/rspec/1.3.0/classes/Spec/Matchers.html#M00...
Perhaps it should be changed so that if you don't pass a class it
out
I remember reading a post where somebody mentioned something like
"sometimes after a refactoring, a test block like
lambda { ... }.should raise_error
catches a NoMethodError in error, thus is actually failing, but the
user isn't notified of the same."
A suggestion in this regard:
change it
On Feb 25, 8:44 am, Matt Wynne wrote:
> Do you mean --format specdoc ?
Interesting.
It appears that with both specdoc and --format nested, it outputs the
test name *after* running it. I would have expected the opposite. Is
this expected?
Thanks.
-r
__
> spec spec --format nested
Cool thanks!
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I'm trying to find a spec parameter that will do something like the
following
$ spec file.spec
Spec: running "it should pass spec x"
.
Spec: running "it should pass spec y"
.
That type of thing.
The use case is that "one" of my tests is outputting some weird stuff
and I want to narrow down on
> spec-server was deprecated and removed a few versions back in favor of
> spork, which works with rspec and test/unit AFAIK.
Right, I was just wondering if there was something that pre-dated
spork, but for test-unit shtuffs...spork does support test-unit but
only barely--trying to see if there's
A bit off topic, but does anybody know if there's an equivalent to
"spec_server" for test-unit style tests?
Thanks.
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
>
> Done:
>
> http://github.com/rspec/rspec-core/blob/master/features/command_line/...
Thanks for doing that.
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
As a note of feedback, when I do a spec --help, I saw this line...
-e, --example [NAME|FILE_NAME] Execute example(s) with matching
name(s). If the argument is
the path to an existing file
(typically generated by a previous
> is allowed, however this code
>
> module Redcar
> describe Project do
> ...
>
> is not.
Oops--appears the problem was that I was running it as ruby instead of
spec (and/or including autorun). Sorry for the noise.
-r
___
rspec-users mailing list
r
Question.
I noticed that this code:
class Redcar::Project
describe FileMirror do
is allowed, however this code
module Redcar
describe Project do
...
is not.
Is this expected?
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rub
When I run autospec, I typically see this double warning--might be
nice to clean it up a bit.
You must 'gem install win32console' to use colour on Windows
You must 'gem install win32console' to use colour on Windows
___
rspec-users mailing list
rspec-use
> Has anyone solved this problem to get lightning fast specs on JRuby just
> like we can with MRI and Spork?
I'm working on a single threaded spork
http://github.com/rdp/spork
it might work with jruby
it sure does speed things up mightily here in windows land
-r
___
Am I correct in assuming this should work (bug)?
# spec.fast_require.rb contains the line require 'spec/autorun'
E:\dev\ruby\fast_ruby_require\spec>ruby spec.fast_require.rb -l25
Only one file can be specified when providing a line number: []
-rp
___
r
> so the question is...whose fault is this? gems? rails?
I think it's rails' fault for not being careful when running
$LOAD_PATH.uniq!
...
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I think I've tracked down why rspec dislikes test-unit gems > 1.3.5
this code:
gem 'rails', '= 2.3.5'
puts $LOAD_PATH.find{|l| l.instance_variables.include?
(:@gem_prelude_index)}
puts $LOAD_PATH.uniq.find{|l| l.instance_variables.include?
(:@gem_prelude_index)}
[if you take off the '= 2.3.5' i
> You do realise you can already nest contexts don't you? That makes
> much more sense to me than what you've suggested.
Ahh that is what I lacked.
That should suffice.
Thanks!
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge
Any interest in the following idea?
a.should include?("1:4") # if there's no matcher called include? then
just call include?
or something along those lines?
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo
> rspec version 1.3.0 has been released!
Thanks for the release.
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Question.
Currently rspec appears to allow for a two-step test system, like
context "abc"
it 'should do y' do
end
end
It might be convenient to have an arbitrary number of nests, like
context "abc"
it 'should do y' do
it 'should also be able to do x'
end
end
end
Thoughts?
-r
_
I saw some tests like this the other day:
it "the nodes are the contents of the directory" do
...
end
Made me wonder if the idea had been proposed to skip the it, like.
"the nodes are the contents of the directory".do {
...
}
or what not.
Thoughts?
-r
> What about something like:
>
> expected # => Fixnum to be a kind of Fixnum
Still in favor of something like this...
:)
-rp
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
> > The very first test I thought up was "this method should return an
> > integer" so kind of a basic test for a not yet existent method.
>
> Isn't this a bit anti-ruby though. Surely the things we should be testing is
> that the object exists, responds to certain messages and gives certain
> valu
> What about something like:
>
> expected # => Fixnum to be a kind of Fixnum
>
> That is more aligned with other failure messages. WDYT?
I quite like it.
In this instance it was
3.class.should be_a Fixnum # fails
I suppose it would be something like
expected # => Class to be a kind of Fixnum
before I hack up a patch for it. Would a patch to change
"expected Fixnum to be a kind of Fixnum"
to
"expected Fixnum to be a kind of Fixnum (is a Class)"
or possibly
"expected Fixnum to be a kind of Fixnum (is a Class, Module, Object,
Kernel, BasicObject)"
have any chance of being accepted
> So we're going to leave it as raise_error for now. If you'd like to push on
> this (which you're welcome to), please add a ticket to lighthouse so it's
> easy to find the discussions around it. If we can get general consensus that
> this would be a good move in spite of the negatives I just outli
> What I really want to say is "should raise(Blah)" but Ruby already defines
> raise as a keyword :)
>
> I'd be open to aliasing raise_error with raise_exception, renaming it to
> raise_exception and aliasing raise_error for compatibility, but I think this
> might just add confusion rather than cla
> context "given a certain set of paths" do
Ahh so it's called context.
Cool (though I'll admit that naming it "given" can make it sound more
like an English sentence, so an alias would be a suggestion).
Much thanks.
-r
___
rspec-users mailing list
rs
Forgive me if the question is a common one...
does rspec have any concept like
given "a certain set of paths" do
it "should be able to recreate them" do; end
it "..."; end
end
?
Thanks.
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
htt
> raise_error already catches any type of exception, error or not:
>
> class BlahException < Exception; end
> class BlahError < StandardError; end
>
> lambda { raise BlahException }.should raise_error(BlahException)
> lambda { raise BlahError }.should raise_error(BlahError)
> lambda { rai
I know there's a raise_error
however...exceptions are not always errors, so I had expected a
raise_exception matcher...would this be a reasonable addition (I'd be
happy to do it).
Thanks.
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://ru
Currently with pending...
it "should do something";
or
it "should do something" do
pending "some work"
end
I get this type of output:
Pending:
After should immediately return if the other process doesn't exist
(Not Yet Implemented)
C:/dev/ruby/wait_for/test/spec.after.rb:5:in `block in '
> You're about 4 years late to the party. We were playing around with a
> variety of options back in 2005 and went with the current syntax because it
> gave us the most flexibility and the highest level of decoupling, making it
> easier for others to create their own matcher libraries. While it wou
> And when it did there was a lot more in the way of methods added to
> Kernel, and that's one of the reasons I avoided RSpec back then, way
> too much Heisenberg effect.
>
> With the current design, there's very little added to all Ruby
> objects, just Kernel#should and Kernel#should_not and that
It is somewhat surprising to me, as a newbie, to have to assert
a.should be_a(Hash)
That extra space in there feels awkward.
Suggestion:
allow for constructs like
a.should.be_a(Hash)
Thoughts?
Much thanks.
-r
___
rspec-users mailing list
rspec-users@r
> What happens when you try it?
>
> (You *do* have the power to experiment, you know. You don't need permission.)
C:\dev\ruby\old\arguments\spec>ruby arguments_spec.rb
arguments_spec.rb:5: undefined method `describe' for main:Object
(NoMethodError)
or adding a
require 'spec'
in there
C:\dev\
> I really like what Aslak and the Cucumber community have done by
> making cukes.info more high level and building up more extensive
> documentation on the github wiki, so I'd rather put energy into
> beefing up the github wiki than improve rspec.info. What do you think?
Using a wiki sound
> > expected: "`four, five` are not recognized argument keywords",
> > got: "`five, four` are not recognized argument keywords" (using
> > ==)
> > ./spec\arguments_spec.rb:140:
>
> Please be sure to post the relevant code when you are asking for help on
> this list. I'll take a guess at what is
perhaps this has been discussed before and you can point me to the
right thread, but is it possible to run specs from the command line
using just ruby?
ruby arguments_spec.rb
and it "just run" (like test/unit seems to)?
I can't think of a great reason why this would be useful, other than
not havi
I'm interested in helping the documentation for rspec, ex:
http://rspec.info/
described similarly to how this person feels (that there's not too
much "getting started" docu).
http://creativedeletion.com/2007/05/27/the-new-rspec-format-testingspecing-in-ruby/
Is there anywhere to fork or what no
Perhaps it would be useful to do some parsing of the messages...
it "should raise an Exception if record is invalid" do
end
# expects that block to raise
Thoughts?
-r
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mail
with 1.8.6 + rspec 1.2.9 (sorry couldn't try trunk, see previous post)
I get:
C:\dev\ruby\old\arguments>spec spec\arguments_spec.rb
..F 0.00 0.00 0.00 ( 0.00)
.F 0.00 0.00 0.00 ( 0.00)
0.015000 0.00 0.015000 ( 0.015625)
.
Is the following expected?
C:\dev\ruby\downloads\rspec>rake gem
(in C:/dev/ruby/downloads/rspec)
in rdoc 2.4.3
rake aborted!
Don't know how to build task 'lib/spec/matchers/extensions/
instance_exec.rb'
(See full trace by running task with --trace)
Thanks.
-r
___
Question.
Currently with this test:
instance.splatted3().should raise_error(ArgumentError)
if it's broken, and returns [] instead of raising appropriately,
currently the error reported is:
expected ArgumentError, got #
shouldn't this have been reported as
expected ArgumentError, got []
?
Mu
57 matches
Mail list logo