Displaying 14 results from an estimated 14 matches similar to: "Partial mock when a complex return value is required"
2008 Jun 07
3
Match render :nothing
Hello guys,
Is there any way to match a render :nothing?
I coudn''t find any way to do this so i''ve just changed my controllers
to do a "head :ok", but it would be nice to know if there is any other
way :)
--
Maur?cio Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
Jo?o Pessoa, PB, +55 83 8867-7208
2006 Jul 24
6
Mocking causes empty specification blocks
I''ve found myself mocking out a published api in my set-up method.
This has led to some contexts having a large set-up and empty
specifications. As the mocks get auto-verified, the specification
blocks have nothing to do but serve as documentation. Does this sound
bad?
Chris
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
2004 Dec 01
2
cp --o_direct
Another question.
When my database is running, I do
[oracle@LNCSTRTLDB03 LPTE3]$ cp --o_direct xdb01.dbf /tmp
cp: cannot open `xdb01.dbf' for reading: Permission denied
[oracle@LNCSTRTLDB03 LPTE3]$
When the database is shudown it works.
Is this normal for ocfs because with any other filesystem I can just
copy a file at any time (Its only a testing, I know I cant copy
datafiles and have
2008 Jun 28
19
Stopping example execution?
Hello, I''m wondering If I am missing something here when creating an example that sets an expecation at the top or beginning of an action but requires you to stub / mock everything that follows.
Example:
I want to test that a certain controller is running a before_filter...thats easy:
- controller.should_receive(:require_user)
- do_get
But now i''ve got to mock / stub
2006 Oct 04
3
do we need stubbing?
Hey all -
The trunk currently supports three types of mocking/stubbing:
Mock Objects (created dynamically at runtime)
Partial Mocking of methods on existing classes
Stubbing of methods on existing objects or classes
The main difference between Partial Mocking and Stubbing is that Stubs
don''t verify.
I''m wondering if we really need the stubbing facility at all, given
that we
2006 Oct 23
6
overriding mock expectations
There is one annoyance I''m encountering with the Mock API in rSpec.
Overall it works well, as far as dynamic mocks go ;)... but there''s
this one thing... It doesn''t allow overriding of expectations.
example:
m = mock("blah")
m.should_receive(:one).any_number_of_times().and_return(1)
m.should_receive(:one).and_return(1)
The second call to should_receive
2007 Jun 22
1
Friday June 22@12:30PM EDT Asterisk Users Conference
Hi,
Quick reminder that the conference is happening today at 12:30 PM EDT.
I'd like to talk more about updating to 1.4. I now have a test box
running asterisk 1.4.5, CentOS 5 and Lumenvox speech rec software.
Seems to be fine except for some double NAT issues that could be
router specific.
Byran Johns from Shelton-Johns is our guest to share some of his
extensive experience. More about him
2007 Jan 25
0
mocking methods that receive blocks - back to mocking Thread again
Hi again,
my last example wasn''t good either. It really makes only sense in the
context of using Thread.
I finally came up with this code, that should now test all important
aspects of running a task in a background thread (to keep it simple, I
left out the exception handling).
see http://pastie.caboo.se/35559 or end of mail.
It seems, TaskRunner is now very well covered by the
2012 May 05
1
rspec-mocks and rspec-rails-2.10.1 are released!
These are patch releases recommended for anybody who has already
upgraded to 2.10.
### rspec-mocks-2.10.1
full changelog: http://github.com/rspec/rspec-mocks/compare/v2.10.0...v2.10.1
Bug fixes
* fix [regression of edge case
behavior](https://github.com/rspec/rspec-mocks/issues/132)
* fixed failure of
`object.should_receive(:message).at_least(0).times.and_return value`
* fixed failure
2007 Feb 20
6
How to spec code with multiple (interacting) paths
Hi
Code with a large number of different paths is probably the biggest
problem I have right now. I''ve made a sample class that illustrates
the simplest case of one parameter that takes two values:
class DataStorer
def initialize(logger, emailer, db_updater, do_update_db_step)
@logger = logger; @emailer = emailer; @db_updater = db_updater
2007 Feb 02
7
Coming Soon...
Dear spec''ers,
As many of you already know, we''re gearing up for a pretty big 0.8
release of RSpec in the next couple of weeks. I''m writing in advance
because I want to give you a heads up about upcoming changes and how
they may impact your existing specs.
Two important things to note first:
1. We will provide a translator that you''ll be able to use to
2008 Jan 18
4
Spam Protection
I was disgruntled with the amount of spam I was getting, so I started
setting up accounts for the various mailing lists I listen to. I use
rspec at showcase60.com to read the mail here. Along with the rspec
news that comes over this channel, I''m getting more and more spam
addressed to this same account, which means that the open way this
list passes around email addresses is
2007 Jul 26
5
Coding standards and whitespace
Recently as a result of using Git I''ve noticed a number of
inconsistencies in the RSpec codebase with respect to whitespace
(mixed line endings, mixed use of spaces and tabs for indentation,
and trailing whitespace at the end of lines). I never would have
noticed, but Git produces nice colorized diff output which highlights
these kinds of inconsistencies.
I wanted to ask if the