similar to: How i write the respec in this situation??

Displaying 20 results from an estimated 600 matches similar to: "How i write the respec in this situation??"

2008 Feb 04
1
Error on nil.build
I can''t figure out why I am getting an error for one of the tests below: ======================== describe AccountsController, "POST" do before :each do @user = mock_model(User) @account = mock_model(Account, :id => 1, :valid => true, :save => true, :users => mock("users", :build => @user)) Account.should_receive(:new).and_return(@account)
2007 Jul 12
3
Agh, this is annoying. Why is this happening?
My problem: Mock ''Task_1005'' received unexpected message :user_id= with (1) No matter what I do to try to stub that out it will still fail out and give me that message. Here is my spec describe TasksController, "handling POST /tasks" do before(:each) do @task = mock_model(Task, :to_param => "1", :save => true)
2007 Aug 21
2
using restful_authentication current_user inside controller specs
I''m using restful_authentication in my app and I have the before filters in my application rhtml: before_filter :login_required around_filter :set_timezone around_filter :catch_errors Currently I have them commented out while rspec''in but I''ll need to add them in my specs. def create @ticket = Ticket.new(params[:ticket]) @ticket.user = current_user if
2011 Dec 02
2
problem setting expectation for test with delayed::job
I''ve got something like this: # post_observer.rb after_create # ...stuff Delayed::Job.enqueue(PostSharer.new(post, post.user)) end ... # post_sharer.rb class PostSharer < Struct.new(:post, user) def perform # Delayed::Job calls .perform on the object passed into enqueue end end # post_controller_spec.rb it "shares the post" do
2007 Aug 17
11
[rspec] looking for a simple refresher
I''ve been off the rspec for a few months and I''m trying to get back on it. 1) Spec::Mocks::MockExpectationError in ''TicketsController handling POST /tickets should create a new ticket'' Mock ''Ticket_1001'' expected :new with ({}) once, but received it 0 times ./spec/controllers/tickets_controller_spec.rb:16: script/spec:4: class
2007 Jan 30
5
errors while testing resource controller using rpec
I am testing a resource called venue in this piece of code (generated using script/rspec_resource) ==================== context "Requesting /venues using POST" do controller_name :venues setup do @mock_venue = mock(''Venue'') @mock_venue.stub!(:save).and_return(true) @mock_venue.stub!(:to_param).and_return(1) Venue.stub!(:new).and_return(@mock_venue)
2012 Jun 17
3
[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
I have a module having the blockaddress instruction. When I link it into another module and delete the original, blockaddress disappears and is replaced by inttoptr (i32 1 to i8*). Please compile and run the attached program to see the demo of this problem. Right after linking modules, blockaddress still exists: @switch.bbs = internal global [3 x i8*] [i8* blockaddress(@my_func,
2007 Jan 08
2
thoughts on mocks and specs
I spent the last couple of days getting my sea legs with Rails and RSpec. I''d been waiting til things seemed calmer before jumping in, and I''m overall very happy with my experience so far. My only real annoyance so far has been forgetting to call "do_post" or "do_create" from my specify blocks. My mocks don''t get the calls they want, and it usually
2016 Mar 18
1
[PATCH supermin] init: Add a blacklist of kmods that we want to exclude from the mini initrd.
We want to exclude virtio-gpu since it's irrelevant, large, and pulls in other unwanted dependencies (modeswitching, drm). Add a second list of kmods which is a blacklist, applied after the first. This reduces the libguestfs initrd size from 39M down to 17M, with concomitant small reductions in boot time. --- src/ext2_initrd.ml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
2009 Aug 10
1
manipulating text to generate different formulas to use in nls()
Hello, In doing a series of non-linear estimations of a function which is a sum of a varying number of sinusoids, I would like to "autogenerate" the arguments needed by nls() depending on that number. For example, when there are two sinusoids: > nls( y ~ mu + A1 * cos(2*pi*f1*x - P1) + A2 * cos(2*pi*f2*x - P2), data = some.xy.data, start = list( mu=some.value0,
2005 Jan 19
1
Problem with ActiveRecordStore
I''m having an issue using the ActiveRecordStore for sessions with Rails 0.9.4.1. When I setup the session object during login I get the following stack trace: IndexError in Login#auth string not matched /app/controllers/login_controller.rb:26:in `auth'' gems/gems/actionpack-1.3.1/lib/action_controller/base.rb:596:in `send''
2007 Nov 08
0
Models for external REST services
Hello, I''m new to rails so as an exercise I''m porting (php to rails) a very simple landing page that talks with a third party REST service where I just need to do a couple of calls to register a user and show the status of the whole process. I felt this would be dead simple to do in Rails (I''m still learning) but I''m having a hard time getting it working. My
1999 Jul 20
1
MS Word from samba share
A few days ago I send a message titled "A samba question or a mutt question". I got a few repies but they suggested wide work-arounds to the problem. I have done some more work and it is clear it is not anything to do with the mail side of what I was trying. The question or problem I have is essentially this:- How do you double click on a MS Word icon to bring the document into MS Word
2009 Jun 16
0
Generation from COX PH with gamma frailty
Hello, I want to generate data set from Cox PH model with gamma frailty effects. theta(parameter for frailty distribution)=2 beta=1.5 n=300 cluster size=30 number of clusters=10 I think I should first generate u from Gamma(Theta,theta) and then using this theta I could not decide how I should generate the survival times? Is there any package for this? or any document you could suggest? Any
2009 Jun 26
1
predicted values after fitting gamma2 function
Question: after fitting a gamma function to some data, how do I get predicted values? I'm a SAS programmer, I new R, and am having problems getting my brain to function with the concept of "object as class ...". The following is specifics of what I am doing: I'm trying to determine the pdf from data I have created in a simulation. I have generated frequency counts
2009 Jun 05
2
p-values from VGAM function vglm
Anyone know how to get p-values for the t-values from the coefficients produced in vglm? Attached is the code and output ? see comment added to output to show where I need p-values + print(paste("********** Using VGAM function gamma2 **********")) + modl2<- vglm(MidPoint~Count,gamma2,data=modl.subset,trace=TRUE,crit="c") + print(coef(modl2,matrix=TRUE))
2016 Feb 17
0
[PATCH supermin v2 1/4] init: Uncompress modules before adding them to the mini initrd.
When building the mini initrd, previously we copied the modules into the initrd as-is, so for example if the module was xz-compressed, we copied the foo.ko.xz file to the initrd. This requires that the mini init binary is linked to zlib & lzma, so that it knows how to uncompress these modules when insmoding them at boot time. Also since the init is statically linked, it required _static_
2002 Feb 12
6
A couple of little R things I can't figure out (column percents, regression with lagged variables)
Simple usage questions that I ought to be able to figure on my own, but can't. 1.I'm able to produce a cross tabulation table showing counts with either table or xtabs. But I want column percentages for interpretation, and it seems stupid to sit there with a calculator figuring marginals and column percentages. How to make R do it after this: > x <- c(1,3,1,3,1,3,1,3,4,4)
2011 Nov 08
0
[LLVMdev] LLVM JIT on a Baremetal x86 Machine !!!
Hi James, I have two questions for you. Firstly, what is the role of 'module' in init.cc? I can see that its being treated like it is a 'bytecode' file, as we open it and then pass it to the ByteCoder and eventually construct llvm module from it. Like In file init.cc, line:121 FILE *stream = fopen("/module", "rb"); ... fread(c, 1, sz,
2007 May 05
4
autogenerated it (was ''Custom Matcher and NAME NOT GENERATED annoyance'')
> On 5/5/07, Luis Lavena <luislavena at gmail.com> wrote: > > describe "A User (in general)" do > > before(:each) do > > @user = User.new > > end > > > > it { @user.should have_many(:contest_public_votes) } > > it { @user.should have_many(:design_industry_user_interests) } > > it { @user.should