similar to: RSpecOnRails - setup or context_setup?

Displaying 20 results from an estimated 10000 matches similar to: "RSpecOnRails - setup or context_setup?"

2007 Jan 24
2
hello! first post + context_setup
Greetings all. I''m looking over a ''greenfield'' pasture, and enjoying the TDD(BDD) process of creation. I''m currently rspec''ing a finite state machine (acts_as_state_machine). As such, I need to persist the model through ''specifies'' within the context - from top to bottom. I have bumped into a couple of probs: 1. context_setup
2016 Apr 22
2
S4 non-virtual class with no slots?
It seems that if an S4 class has no slots it can't be instantiated because it is assumed to be virtual. Is there a way around this other than adding a do-nothing slot? A singleton would be OK, though is not essential. Problem: EmptyFitResult <- setClass("EmptyFitResult", representation=representation()) # also tried it without the second argument. same result. > e <-
2007 Jan 04
8
Common setup code and naming specifications
Hello! I have a lot of contexts for testing Rails controllers, that must do something like ''session[:logged_in] = true'' in their setup. How can this be refactored? In unit tests I would simply create a LoggedInControllerTest base class, that all my functional tests would derive from. And another small question: In my controller specifications I often have to decide whether to
2009 Apr 18
0
A bug in sweeper.rb? [was: A frustrating and strange error when config.action_controller.perform_caching = true]
I fired up the debugger and watched the code happen tonight. The problem occurs if the config.action_controller.perform_caching = true in your environment. It''s not set to true in development but it is set to true in production and staging. The problem occurs not in my controllers but in sweeping.rb (part of rails). Rails calls this code for every controller which was instantiated in
2010 Dec 09
4
[LLVMdev] tblgen internals
Is there a reason that RecordKeeper:: getAllDerivedDefinitions(...) implementation accesses the global Records instance instead of just referencing itself? As far as I can tell from the usage: 1) Records has the linkage as extern RecordKeeper Records in Record.h 2) Is instantiated as a global in TableGen 3) All llvm uses of getAllDerivedDefinitions SEEM to be manifested as a message to this
2010 Dec 09
0
[LLVMdev] tblgen internals
On Dec 9, 2010, at 4:50 AM, Garrison Venn wrote: > Is there a reason that RecordKeeper:: getAllDerivedDefinitions(...) implementation > accesses the global Records instance instead of just referencing itself? > > As far as I can tell from the usage: > > 1) Records has the linkage as extern RecordKeeper Records in Record.h > 2) Is instantiated as a global in TableGen >
2006 Jun 26
1
ActiveRecord, instance_eval, and PStore
I''m trying to add some per-object behaviors to objects descended from ActiveRecord, by using after_initialize() and instance_eval(), like this: def after_initialize self.instance_eval(File.read(''customers/default.rb'')) end (Ultimately the file path will be dynamic, this is just proof of concept.) default.rb just contains a few method definitions like this one: def
2016 Apr 23
0
S4 non-virtual class with no slots? [SOLVED]
Thanks, Martin, that (inherit from a virtual class) worked great. I already had a base class created with setUnion, and so this was an easy switch. I had assumed that since inheriting from a class without slots would produce a class without slots the result would still be virtual. Fortunately that's not the case. Ross ________________________________________ From: Martin Morgan
2010 Dec 10
1
[LLVMdev] tblgen internals
Attached patch for removing for the first trivial RecordKeeper:: getAllDerivedDefinitions(...) dependency on the global RecordKeeper Records instance. The real work will be removing this dependency from the other Record.h classes/structs, and from TGParser. Thinking this would be implemented as some sort of context structure/class holding a RecordKeeper instance passed to TGParser which in turn
2010 Dec 10
2
[LLVMdev] tblgen internals
Hey Chris, Ok, so I'm working on creating this trivial patch, for starters, but I'm trying to identify a controlled unit test for tblgen. So all of the following test tblgen to various extents: 1) make 2) make unittests 3) make // with clang and 4) make check // which I'm avoiding Since I'm just starting to understand tblgen, I'm not comfortable with any of these
2006 Jan 23
5
Variable Scoping Problem
I am having some problems with variable scoping. I need to be able to set a variable that is accessable by other methods within the class (or instance) (i.e not global). An example is 2 pages that change a class variable: class AjtestController < ApplicationController def initialize @@variable = "init" end def show @display = @@variable @@variable = "change 1"
2010 Feb 10
0
[LLVMdev] Jit singleton
Thanks for the patch! I'll clean this up, convert your sample to a unit test, and commit it for 2.7. On Sun, Feb 7, 2010 at 6:09 AM, Olivier Meurant <meurant.olivier at gmail.com> wrote: > Hi Jeffrey, > > Thanks for pointing me in the right direction ! > I'm not using the JIT in lazy mode, but it was fun to understand the > lazy-stub code. > > Attached you will
2010 Feb 10
1
[LLVMdev] Jit singleton
Thanks Jeffrey ! If possible, keep me inform (on revision number), I'm interested to see how you will do the unit test. (For my future patch... :) ). Thanks again. Olivier. On Wed, Feb 10, 2010 at 6:22 PM, Jeffrey Yasskin <jyasskin at google.com>wrote: > Thanks for the patch! I'll clean this up, convert your sample to a > unit test, and commit it for 2.7. > > On Sun,
2013 Sep 08
0
PhD Studentship: Geographically Weighted Geodemographics [University of Liverpool]
Supervisors: Dr Alex Singleton; Professor Chris Brunsdon Industrial Partner: Office for National Statistics Applicants are invited for a PhD studentship at the University of Liverpool within the ESRC North West DTC. The studentship will be supervised by Dr Alex Singleton and Professor Chris Brunsdon in the Department of Geography and Planning; and is being conducted in collaboration with the
2008 Mar 08
3
should_receive(:foo).with(any_object)
Hey, I just ran into a situation where I would like to expect a method call with an argument I know and another one, which is a random number. I think mocking up the rand method is somehow ugly so I thought maybe this is the first time where I can take something from Java to Ruby ;) Java''s EasyMock mocking library knows things like "anyObject()" and "anyInteger()" in
2006 Jul 06
0
Layouts, Searching/Sorting
Two questions for you all... 1. I have an admin section to a site I''m building. Here''s the pertinent bit of the layout that all controllers are using: <div id="main-content"> <%= @content_for_layout %> </div> <div id="sidebar"> </div> I''m using @content_for_layout to display various controller actions such as new,
2013 Oct 25
1
Intern at Barron's ! -- use statistics for investigative financial journalism
We're seeking interns for the summer of 2014 here at Barron's the Dow Jones newsweekly that's searched out good investments and financial frauds since 1921, when our founder exposed Charles Ponzi. We're at the center of the financial world in New York and can pay a bit of a stipend to cover the city's high living costs. Here's the blurb: Do some good. Intern at
2006 Apr 27
3
Routing problem
Hi, I am having a routing problem and can''t figure out why its happing. I have added the following line in my routing.rb file. map.connect ''name/:id'', :controller => ''controller_name'', :action => ''action_name'' When I use http://domain.com/controller_name/action_name/id then it works fine on the local machine using webrick
2004 Dec 14
0
[LLVMdev] misc. patches
Morten, The leaks.patch file introduced a static destructor ordering problem which lead to garbled output. The comment above those lines of code indicates why it needs to be the way it is. My bad for committing it in the first place. Please be careful in the future. Reid. On Mon, 2004-12-13 at 05:30, Morten Ofstad wrote: > Hi, > > here are some minor patches that for various reasons
2010 Feb 07
3
[LLVMdev] Jit singleton
Hi Jeffrey, Thanks for pointing me in the right direction ! I'm not using the JIT in lazy mode, but it was fun to understand the lazy-stub code. Attached you will find a patch which follow your 1st option : a map Stub_address -> JITResolver instance, except that the used map is a "std::map" to apply the same upper_bound trick as in the map CallSiteToFunctionMap of the