similar to: [RSpec] Error when returning multiple values from a stub

Displaying 20 results from an estimated 1000 matches similar to: "[RSpec] Error when returning multiple values from a stub"

2017 Jan 18
4
[Bug 12527] New: Sender waits for timeout when fuzzy basis file found
https://bugzilla.samba.org/show_bug.cgi?id=12527 Bug ID: 12527 Summary: Sender waits for timeout when fuzzy basis file found Product: rsync Version: 3.1.2 Hardware: All OS: All Status: NEW Severity: critical Priority: P5 Component: core Assignee: wayned at samba.org
2018 Mar 16
3
Discrepancy: R sum() VS C or Fortran sum
Hi all, I found a discrepancy between the sum() in R and either a sum done in C or Fortran for vector of just 5 elements. The difference is very small, but this is a very small part of a much larger numerical problem in which first and second derivatives are computed numerically. This is part of a numerical method course I am teaching in which I want to compare speeds of R versus Fortran (We
2018 Mar 16
1
Discrepancy: R sum() VS C or Fortran sum
My simple functions were to compare the result with the gfortran compiler sum() function. I thought that the Fortran sum could not be less precise than R. I was wrong. I am impressed. The R sum does in fact match the result if we use the Kahan algorithm. P. I am glad to see that R sum() is more accurate than the gfortran compiler sum. On 16/03/18 11:37 AM, luke-tierney at uiowa.edu wrote:
2005 Feb 19
0
[PATCH] check read/write return values
The Fedora build system is in paranoid mode, and compiles everything with -Werror. Additionally, it checks that the return values of calls like read and write are checked. The build exits with errors like: xen/lowlevel/xc/xc.c: In function `pyxc_vmx_build'': xen/lowlevel/xc/xc.c:464: warning: ignoring return value of `sscanf'', declared with attribute warn_unused_result
2002 Sep 06
3
Histogram Ranking
Hello, This is not exactly an R question, but I suspect that there is an R procedure that does what I am calling (for lack of a better name) "histogram ranking". I'm trying to evaluate a set of regression features by segregating by target class and comparing the feature histograms. My idea is that if the histograms are the same for two different classes then there is no
2007 Oct 08
6
stub actions that depend on the parameter
Hi, I''m pretty new to all related to bdd and rspec and I have the following question. Is it possible to stub actions that return different objects depending on the parameteres they were called with? Something like this: MyClass.stub!(:method).with(1).and_return(@mock_object_1) MyClass.stub!(:method).with(2).and_return(@mock_object_2) I know I could use
2010 Jul 13
2
[Rspec] Difference between stub and message expectation with any_number_of_times
I''m wondering what''s the difference between stub and message expectation with any_number_of_times, for example: myMock = mock("mymock") myMock.stub!(:is_a?).with(MyClass).and_return(false) and myMock = mock("mymock") myMock.should_receive(:is_a?).with(MyClass).any_number_of_times.and_return(false) because is_a? may not be called at all, it just like a
2003 Dec 15
6
interface bonding
----- Forwarded message from John <strgout@mail.unixjunkie.com> ----- Date: Mon, 15 Dec 2003 17:58:15 -0600 From: John <strgout@mail.unixjunkie.com> To: freebsd-stable@freebsd.org Subject: interface bonding User-Agent: Mutt/1.4i Is there any way to bond sniffer interfaces? I've read a little on netgraph and it seems like i maybe able to use that but i'm not sure how to go
2007 Dec 09
2
Getting estimates from survfit.coxph
Dear all, I'm having difficulty getting access to data generated by survfit and print.survfit when they are using with a Cox model (survfit.coxph). I would like to programmatically access the median survival time for each strata together with the 95% confidence interval. I can get it on screen, but can't get to it algorithmically. I found myself examining the source of print.survfit to
2007 Sep 11
1
Can NOT overides the stub! in the setup
Hello, I am new to rSpec. I tried to search in the list, but could not find the answer, please forgive me if somebody already answered this. Here is my question: I have a stub in setup: before(:each) do @current_user = mock("devsu") # Generally, prefer stub! over should_receive in setup. User.stub!(:find).and_return(@current_user) session[:user] = @current_user.id
2011 May 14
1
RSpec stub question
Hi I am using Mongoid. In Mongoid while saving a record we typically give like in the controller @post.safely.save For a model class Post I am writing rspecs for my controller and want to mock the model. So what I am doing is let(:post) { mock_model(Post).as_null_object } before(:each) do Post.stub(:new).and_return(post) end it "creates new post"
2007 Jun 26
4
Can I stub a method on a belongs_to association:
describe Asset, " when destroyed" do fixtures :assets, :videos, :sites, :publish_settings before(:each) do @asset = assets(:test_asset) @mock_hook = mock("hook") @asset.video.stub!(:hook).and_return @mock_hook # error occurs here end it "should call the delete hook" do @mock_hook.should_receive(:update).with("test_video",
2007 Jul 27
5
File.stub!
Hi, I''m trying to stub File.open and whenever I do, rspec blows up with the following error message (undefined method `add'' for nil:NilClass), which seems to happen because method __add in class Proxy is calling #add on global $rspec_mocks, which in turn is nil. Can someone explain what I''m doing wrong, as I can''t seem to stub anything out! Here''s
2007 May 29
5
Trouble defining a stub method for a controller
Hello, Not sure if I am doing something really wrong (let''s not say stupid for now), but I haven''t been able to stub a controller method like: controller.stub!(:logged_in?).and_return(true) Please help, this is driving me nuts ;-) -- An?bal Rojas http://www.rubycorner.com http://www.hasmanydevelopers.com
2008 Nov 03
1
stub! and null_object
I have some code I want to stub out as it''s not part of what I''m testing. It''s got a bit of DSL going on, so there are method calls chained together. The call I want to stub out looks like this: user.record_action(:uploaded_a_photo => concert).with_result(photo) So ideally, I''d just do @user.stub!(:record_action) and that would return a null
2008 Jan 30
2
Stubbing controller methods vs model methods
I had an error that I couldn''t figure out, then when writing up a question for the forum I figured it out. The thing is I don''t understand why the change that was made works and why what existed before didn''t. Here is the initial post when I had the error: ---------------------------------- In the controllers/application.rb file I have a method that finds the account
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
2007 Oct 05
7
Easy AR association stubbing
I''ve added a method to the mock class that makes it pretty easy to stub associations in rails. I''ve been using it for awhile and it seems to cut down on a lot of setup code for the controller and model specs that use associations. #before @person = mock_model(Person) posts = mock(''post_proxy'') posts.stub!(:build).and_return(mock_model(Post, :save => true))
2007 Oct 16
1
Stub ActionController::Base#params
Has anyone had any success stubbing ActionController::Base#params? The following is not intercepting calls to params[:foo] in my controllers: ActionController::Base.stub!(:params).and_return(:foo => ''bar'') -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071016/282a76ba/attachment.html
2011 Jun 23
2
RSpec book help; why won't this stub method work?
Subscription model-------------------------------------------- class Subscription < ActiveRecord::Base has_one :user def can_send_message? if user.sent_messages.count < limit true else false end end end Subscription model spec-------------------------------------------- require ''spec_helper'' describe Subscription do describe