Displaying 20 results from an estimated 20000 matches similar to: "mocking/stubbing ferret"
2006 Oct 04
0
stubbing/partial mocking
All,
Brian Takita has been contributing to a stubs branch to support
stubbing and partial mocking on Modules (and therefore classes). I
tweaked the syntax a bit and merged it into the trunk, so you can
update from the trunk and check out the new stubbing/mocking love. If
you prefer to wait for a release, there should be one coming soon-ish
(I''m aiming for later this week).
As Brian
2007 Oct 25
1
Mocking/Stubbing help with subdomain as account key
My app uses account_location to set up subdomains as account keys. In
my controllers, all my model operations are scoped through the
@current_person object.
The question is: How do I test this with RSpec''s mocking and
stubbing? Basically, I need to test that @current_person.things is
getting the find message and returning @thing. I''ve tried stubbing
and mocking
2008 Jan 25
2
strange capistrano problem
When trying to start ferret with capistrano, I keep getting this:
$ cap services:ferret:stop
domain [redken.digitalpulp.com] :
user [john] :
* executing `services:ferret:stop''
* executing "cd /srv/rails/redken/current; script/ferret_server -e
production stop"
servers: ["redken.digitalpulp.com"]
Password:
[redken.digitalpulp.com] executing command
***
2007 Mar 27
2
mocking/stubbing newbie questions
I''m new to mocking and stubbing. Can someone help me out with the
following? I don''t exactly know why this spec is failing:
describe "GET /users/1/terms" do
controller_name :terms
setup do
@user = mock_model(User)
User.stub!(:find).and_return(@user)
end
def do_get
get :index, :user_id => 1
end
it "should find all terms
2006 Oct 11
0
stubbing/mocking
All,
Inspired by a conversation on the mocha list, I added the ability to
mix stubs w/ mocks on the same methods.
Here''s what it allows:
context "a mock" do
specify "can stub! and mock the same message" do
mock = mock("stubbing mock")
mock.stub!(:msg).and_return(:stub_value)
mock.should_receive(:msg).with(:arg).and_return(:mock_value)
2007 Mar 29
3
ferret/lucene syntax
I jut noticed this example in the lucene documentation*:
title:(+return +"pink panther")
I have been using this syntax:
+title:(return AND "pink panther")
Seemingly with success. Are both acceptable? I couldn''t find any
documentation on "the plus sign" itself.
Thanks for any pointers.
John
2007 May 29
1
When does ferret / AAF decide to reindex?
I am experience situations where accessing the index results in a
complete re-indexing of the model. I have not been able to detect a
pattern.
Under what circumstances does Ferret (or AAF) decide that it needs to
rebuild the index? I''ll be happy to look at the code relevant to this
if someone could direct me to it.
Thanks,
John
2007 Apr 01
7
baffling sort problem
I had sort-by-date working almost perfectly with my app. It was
behaving as expected for most data, but had a few hiccups with
certain data. I investigated and discovered that the correct data was
storing this in my ferret index: "1999-10-18 00:00:00" and the
incorrect data was storing this: "Mon Oct 18 00:00:00 EDT
1999" (oops...)
So I of course had to fix the
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
2007 Jun 08
2
getting the list of indexed words from ferret or aaf
is the list of indexed words readily available via aaf or directly from
ferret?
--
Posted via http://www.ruby-forum.com/.
2008 Jan 10
4
Mocking and stubbing Rails'' association extensions
I''m having a lot of trouble stubbing out an association extension for
some view tests. Example rails code modeling a music album:
class Album < ActiveRecord::Base
has_many :songs do
def streamable
find(:all, :conditions => ''streamable = 1'')
end
end
end
So for a given Album instance (say @album), I need to be able to stub
both
2006 Sep 13
0
mocking or stubbing a private method
Is there any way to mock or stub a private method on an instance? When I try, I
get the message "Exception: undefined method ''foo'' for #<MyClass:0xb721cbc8>.
Thanks for the help,
Haakon
2008 Jan 28
1
lock index when not using drb server?
We all know that using ferret/aaf without the drb server is not
thread-safe-- but why not? Would it be so hard to sacrifice
performance by using a simple locking system?
Very often I run into a situation where I want to quickly stage a
project, and I want to use a few mongrels but don''t want to configure
every last piece of the system, including the drb server. It would be
nice
2007 Apr 09
5
IndexReader#terms for all fields?
Is it possible to query the index for a TermEnum for all fields in
the index instead of just ?
Thanks,
John
2007 Mar 31
5
DRb server & aaf gem
I''m having problems getting the DRb server running with the aaf gem.
I tried it with the plugin installed in my application, and it
worked. I suspect the problem has something to do with the startup
scripts expecting certain files to be in certain relative file paths.
Any insights are appreciated, and maybe if you have time you can
update the wiki document :)
Thanks for a great
2007 Feb 05
2
Mock objects for stubbing out Paypal - anyone have any???
Hi,
Just wondering if anyone has already developed a mocking approach to stub
out the Paypal interface so that one can test on an internal PC which
doesn''t provide a means for PayPal to callback to your webserver? (i.e.
once the app is deployed to the hosting provider it would then work as
PayPal could then hit the application with the specified URL).
Anyone already solved this? What
2006 Dec 22
0
Error using Ferret - ferret/index.rb:271:in `delete''
We are using Ferret on our site answeru.com. Today all of a sudden we
started getting Ferret errors while users were trying to register or log
into the system. I am not a Ferret techie - I apologize if a similar problem
has already been asked or if it is not really a Ferret issue.
Any ideas:
IO Error occured at <except.c>:79 in xraise
Error occured in fs_store.c:324 - fs_open_input
2006 Nov 30
2
Fatal error when require ferret
Hello list,
I just started using ferret and it really doesn''t go my way.
Doing
gem install ferret outputs ->
make install
/usr/bin/install -c -m 0755 ferret_ext.so /var/lib/gems/1.8/gems/
ferret-0.10.13/lib
make clean
Successfully installed ferret-0.10.13
Installing ri documentation for ferret-0.10.13...
Installing RDoc documentation for ferret-0.10.13...
In ferret.rb ->
2007 Jan 11
1
Ferret Locking issues
Dave and all,
I run a medium RoR app using Ferret and acts_as_ferret. I get a lot of
lock errors. Not always but around 5% of all searches (aspecially during
peak periods). Here are the messages I get:
A NameError occurred in szukaj#index:
uninitialized constant Ferret::Index::Index::LockError
[RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/dependencies.rb:478:in
2005 Nov 22
1
Ferret NoMethodError
Using the current ferret gem (on Win-XP):
irb(main):001:0> require ''ferret''
c:/ruby/lib/ruby/1.8/fileutils.rb:950: warning: already initialized constant
OPT_TABLE
=> true
irb(main):002:0> include Ferret
=> Object
irb(main):003:0> index = Index::Index.new
=> #<Ferret::Index::Index:0x3477ba8 @qp=nil, ...>
irb(main):004:0> index << "This is