similar to: stub actions that depend on the parameter

Displaying 20 results from an estimated 2000 matches similar to: "stub actions that depend on the parameter"

2006 Jan 01
4
rails under windows and mysql make webrick unstable
hi, I have installed ruby and rails under windows(exactly this one: http://rubyforge.org/frs/download.php/4174/ruby182-15.exe that includes rubygems) the thing is that while trying to install the mysql gem, it seemd to try to build the native extension, so I finally added a compiled version that I found in http://dema.ruby.com.br/ the problem is that webrick behaves quite unstable while
2006 Jan 01
5
scaffold not working on Windows XP
Hello, I did a fresh install of ruby182 and gem rails --include-dependencies Now when I do: rails receipts cd receipts ruby script\generate scaffold receipt receipt rails does not create the views or controller. What can I do? Thanks Frank
2013 Jul 09
2
OCZ Vertex4 quirks
Same as its brothers/sisters, it's optimized for 4 KB blocks. /* * OCZ Vertex 4 SSDs * 4k optimized */ { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ_VERTEX4*", "*"}, /*quirks/DA_Q_4K Borja.
2013 Nov 26
2
Xen private network across multiple physical servers
Hi, I would like to configure a Xen private network where the guests use private addresses. So far I have setup the Dom0 instances and the vm''s can access to the other guests inside the same server. Now my question is how can the guests reach the other guests that are located in other physical servers. Here is a diagram of how the network looks:
2006 Dec 21
3
Speccing private class methods
Hi How can I specify that a private method of a class gets called? If you run the code below, only spec (1) passes. Spec (2) is what I found causing problems in my code, and class (3) is my failed attempt to work around it. (3 really puzzles me - why is a private class method not accessible via send?) Another problem is that stub! makes public methods, which changes the behaviour of
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
2008 Oct 16
2
rails and security
Hi, I am wondering if there is a way to secure rails application logs ? My issue is that I discovered that form parameters are shown in clear in the logs. So when users are authenticating, you see the login and password in clear Processing LoginController#index (for xxxxx at 2008-10-16 11:22:43) [POST] Session ID: 8cb95e2e50332added5715eff9e84938 Parameters:
2007 Feb 28
12
Specifying that code is called in a block
Not sure if this is possible currently. I have a section of code like this: ActiveRecord::Base.transaction do cow.save! duck.save! dog.save! end (Names changed to protect the innocent.) I''d like to specify that the saves run in a transaction. I can do ActiveRecord::Base.should_receive(:transaction).and_yield But is there any way to specify that the code is
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
2010 Jul 26
3
Cluster analysis
Hi all, I have no idea if this question is to easy to be answered, but I?m starting with R. So, here we go. I have a large dataset with a lot of steps a judicial case. A sample is attached. I?d like to do a cluster analysis to try to understand with one is the most usual path followed by this legal cases. After that, I?d like to plot a cluster tree. In the attached sample, the column: -
2012 Jul 14
2
[LLVMdev] Issue with Machine Verifier and earlyclobber
Hello Jakob, I'm still getting the error, I can give you any other debug info you need. I haven't pasted the regalloc debug info here because it is quite huge, but if you tell me what specific details you need I will include them. Thanks for your help! 2012/7/14 Jakob Stoklund Olesen <stoklund at 2pi.dk> > > On Jul 14, 2012, at 10:09 AM, Borja Ferrer <borja.ferav at
2013 Jan 07
2
[LLVMdev] LLVM ERROR: ran out of registers during register allocation
Hello Jakob, Did you get a chance to take a look into this, and if not, can you do it when you get some spare time? Thanks! 2012/12/19 Borja Ferrer <borja.ferav at gmail.com> > We did something like this back when the register allocator couldn't split >> live ranges. >> > > Yes, I remember the isWinToJoinCrossClass() function, removed here: > >
2007 Mar 30
2
Replacing slot of S4 class in method of S4 class?
Dear all, Assume that I have an S4 class "MyClass" with a slot "myname", which is initialized to: myname="" in method("initialize"): myclass <- new("MyClass", myname="") Assume that class "MyClass" has a method "mymethod": "mymethod.MyClass" <- function(object, myname=character(0), ...) {
2020 May 12
4
S3 method dispatch for methods in local environments
Dear All, In R 3.6.3 (and earlier), method dispatch used to work for methods stored in local environments that are attached to the search path. For example: myfun <- function(y) { out <- list(y=y) class(out) <- "myclass" return(out) } print.myclass <- function(x, ...) print(formatC(x$y, format="f", digits=5)) myfun(1:4) # prints: [1]
2005 Dec 07
1
Dots argument in apply method
Hello everyone, I'm working on a package using S4 classes and methods and I ran into the following "problem" when I tried to create an "apply" method for objects of one of my new classes. I've found a way around the problem but I wonder if I did not paint myself into the corner. I'd like your opinion about that. So I have an object "myObj" of class
2007 Oct 05
13
spec''ing view render partial collection, local variable not found
I''m trying to spec out a render partial collection but I get the following error 2) NoMethodError in ''/games/_game.rhtml should show game name'' undefined method `body'' for #<#<Class:0x316580c>:0x2f1154c> /Volumes/EXTERNAL/web/omenking.ca/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb:12:in `matches?''
2019 Jul 07
3
Possible bug in `class<-` when a class-specific '[[.' method is defined
Hi all ! I noticed a strange behaviour of the function `class<-` when a class-specific '[[.' method is defined. Here below a reproducible example : #-------------------------------------------------------------------. counttt <- 0 `[[.MYCLASS` = function(x, ...) { counttt <<- counttt + 1 # browser() x = NextMethod() return(x) } df <- as.data.frame(matrix(1:20,
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture- driven way of spec-ing or mocking. How the heck to you mock this so the code at line (2) and (4) work right? I''m still struggling with mocks but it seems like this can be done. Forgive the naivety of this question. 1. def change_quantity 2. @line_item = LineItem.find_by_id(params[:id]) 3. unless
2011 Oct 31
1
Question about copying reference objects using the initialize method
Dears, I have a question about copying reference objects using the initialize method. 1) If the latter has no arguments, there is no problem to copy an object. myClass = setRefClass("myClass", fields = list(value = "numeric") ) myClass$methods(initialize = function(...){ ? value <<- 1 ? callSuper(...) }) newObject = myClass$new() newObject$value = 2 copyObject =
2008 Dec 20
2
Print a list in columns
Dear R-Users I have a list with two vectors of doubles tha have different lengths. I want to export it to a file and I also want to print it in two columns. I try with write.table but it need vectors of the same length. Does anyone know how to do it? Thanks Borja [[alternative HTML version deleted]]