Displaying 20 results from an estimated 40000 matches similar to: "pending w/ no string"
2007 Apr 20
5
stubbing with and without a string
What is the difference between these two ways of mocking (with and
without the string):
mock(''Object'')
and
mock(Object)
?
Scott
2007 Oct 08
17
(no subject)
Just ran svn up this morning, and got this (after running ./script/
generate rspec)
escher: ./script/spec spec/models/item_spec.rb
Finished in 8.0e-06 seconds
0 examples, 0 failures
./script/spec:4:in `run'': wrong number of arguments (3 for 1)
(ArgumentError)
from ./script/spec:4
Using rails 1.2.3, rspec trunk, on Mac OS X.4.9.
Any ideas, or is this a bug in
2007 Apr 01
11
--color doesn''t work with --drb w/rspec_autotest
If I got this to work, do you think we could/should check in
rspec_autotest into rspec?
I''ve updated rspec_autotest abit, so let me know if you''d like the
modified code.
Scott
2007 Dec 06
6
mock libraries, Object#send, and Object#__send__
What is the appropriate way to stub out (and put an expectation on
Object#__send__), without getting warnings from the Rspec mock library?
Scott
2007 Jun 08
20
When to use BDD/TDD w/ external libraries
Test First Development is great...But should you use it when you are
adding classes/methods on to external library that doesn''t have an
extensive test suite? I noticed that the rspec plugin for autotest
has no specs.
David Chemlinsky said something to the list a while back that has
been stewing in my subconscious - that you develop software
differently using Test First
2007 Oct 23
9
Running rails specs outside of the normal project tree
I want to create a spec/regressions directory with various
regressions (for my rails project). I tried the following:
describe LoginController, "regression for user creation when
steves_sister does not exist", :behavior_type => :controller do
controller_name :login
before :each do
@params = {
"commit"=>"Create Account",
2007 Aug 06
5
using RSpec''s trunk in non-rails projects w/ Autotest
I believe for rails projects you can put rspec''s code repos into
vendor/plugins, and autotest will automatically use the rspec binary
in that directory, and not the gem installed.
Is there an easy way to do this for non-rails projects? There are a
few advancements on trunk which I would like to take advantage of.
Tips welcome ; ).
Scott Taylor
2007 Apr 10
5
using YAML for --failures and --examples
As it is currently, in trunk, --failures and --examples except a text
file, each line containing the name of a spec.
I''m wondering: Would a a patch to use YAML (instead or as well as)
plain text be welcomed? I''m thinking of a yaml file like the following:
spec_file_1:
file: spec/person_spec.rb
specs:
- should have first name
- should provide email address
2007 Mar 19
24
alias method spec?
I am completely baffled by this one - My guess is that there is no
pure ruby way to do this - but how could I set up a spec to test that
one method is an alias of another?
Thanks for any help,
Scott
2007 Apr 01
4
rake w/rspec
How can I spec out a rake task?
How can I use rake in my spec''s? I want to fix this rake
spec:autotest bug with --drb and --color. How can I get rake output?
How would I get out of autotest? My initial thought is just to run
the command in the spec.
Scott
2007 Sep 08
11
changes to TextMate bundle
Hi all, I got some help from James Edward Gray II on the RSpec
TextMate bundle. For those of you who don''t know James, he runs the
Ruby Quiz and also maintains the official TM bundle.
Per a couple of patches from him and some advice that I acted on, many
of the shortcuts have changed.
The bad news is you''ll have to learn new shortcuts.
The good news is that the new shortcuts
2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running
the following:
should_render(:index)
should_be_valid
should_not_be_valid
should_respond_to
should_be
should_render
I thought the syntax changed to something like the following:
obj.should render(:index)
but this doesn''t seem to work.
Scott
2007 Jun 11
3
hpricot as dependency for building rspec?
It looks to me that hpricot is a dependency to building rspec:
euclid% rake pre_commit
(in /Users/smtlaissezfaire/ruby/projects/rspec/hpricot)
rake aborted!
Could not find RubyGem hpricot (>= 0.0.0)
/Users/smtlaissezfaire/ruby/projects/rspec/hpricot/rakefile:9
(See full trace by running task with --trace)
Let me know if I''m wrong. Otherwise, I''ll submit a patch in the docs.
2007 Dec 18
16
shared behav
hi, i want to make a behavior shared between models, the examples
need to create new instances etc. Is there a way to pass the model
class to the shared behavior?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071218/5b400cc5/attachment-0001.html
2007 Mar 19
3
controller_name with dynamic controllers
I''m writing a controller which should only be inherited from,
something like the generic crud controller seen here: http://
geekonomics.blogspot.com/2006/07/crud-and-shared-controllers.html
Now, in my spec, I would like to create a controller which inherits
from the generic CRUDController, without actually creating the
controller. This controller is *only* for testing.
How can I
2007 Apr 17
8
Verifying that a block calls a method
I have something like the following:
def my_fun
my_fun2 do
raise Error
end
end
I know that I can verify that the method receives my_fun2. How can I
mock/stub out the example to verify that it calls raise Error?
Scott
2007 May 11
12
tutorial
Hello, Hello
Where i can found a good tutorial about Rspec ?
thanks
2007 Aug 08
5
and_yield + instance_eval(&block)
I have the following code, which yields instance eval''s the block given:
class Foo
def bar(&blk)
instance_eval &blk
end
def baz
yield
end
end
The effect of this is that self is reassigned:
Foo.new.bar do
# here, self is the instance of Foo
# created by new
end
But normally self is the object in which
Foo.new.bar {...} occurs.
Foo.new.baz do
2007 Feb 27
8
Using a subversion repository to spec in a rails app
Is it a bad practice to use a subversion repository to the trunk of
rspec and rspec_on_rails? Or rather, is it doomed to fail, since my
gem will always be out of date?
I know I can''t use spec, installed from gem,s if I have the latest
revision of rspec and rspec_on_rails checked into my plugins
directory. But I should still be able to use it with the --drb
option, correct?