similar to: Foreign key constraints, fixtures, and rake task

Displaying 20 results from an estimated 700 matches similar to: "Foreign key constraints, fixtures, and rake task"

2007 Aug 06
2
Specifying custom rails FormBuilders
I want to write a spec for a custom form builder, but I''m not really sure where it should live or how to include the right rspec_on_rails contexts. Ideally, I should be able to write a spec like: describe LabelledBuilder do it "should let me create a text field" do object = mock(object) object.stub!(:attribute).and_return("Test String") render
2006 Oct 17
3
Should fixtures be transactional?
I started using the new Model.should_have(1).records expectation in rspec_on_rails, and quickly realized that my fixtures were remaining loaded, even in contexts that didn''t use them. Bug or feature? Jay Levitt
2007 Aug 13
2
Backtrace tweaker - broken or me?
Using 1.0.8, I just realized that I''ve been scrolling through pages of backtraces when rspec is supposed to clean them up for me. This is a new development machine, so I''m not sure if older versions worked or not. I''m running Ruby 1.8.6, Rails edge, Mac OS X 10.4.10. I''ve verified that the QuietBacktraceTweaker is the one that''s running.
2007 Aug 16
17
undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8>
I am getting: undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8> with my view specs after upgrading to 1.0.8. Is anyone else seeing this? To isolate the message I did the following setup: - create new rails project (with edge) - installed rspec and rspec_on_rails - ran rake spec - ran script/generate rspec_scaffold products - tried to run a builtin view
2006 Nov 07
7
should_redirect_to in advance - feels unnatural
I can understand that it''s easier for rspec to set up a mock in advance of the controller call. But it makes it difficult to do something like: context "The HarkController, given Louie the logged-in user" do setup do post :login, :username => ''louie'', :password => ''atest'' end specify "should redirect Louie to the home
2007 Jan 21
35
Collection proxies need to be stubbed ?
Hi all ! I just started writing specs on a new project. I would just like to validate that this is the way you would write it. I know about mocks, stubs and expectations. I don''t think this is a problem for me. My question really boils down to: def index @projects = current_user.projects.active end My spec needs to return the proxy, no ? Here''s my code: context "A
2007 Aug 30
7
mock_model in spec/lib
Has anyone else run into a problem with trying to use mock_model in spec/lib ? For some reason, I can take the same spec, put it in spec/models, have it run fine, but put it in spec/lib, and have it complain about not being able to find #mock_model Thanks, Edward
2007 Aug 02
2
got/expects causes mental layering violation
I was, for the first time, spec''ing a class that redefined ==. And my spec was incorrect, so == was returning false. The result was something like: class C def ==(other) false end end .. C.new.should == other... expected other, got #<C:0x7f03c454> (using ==) But wait! Why on earth is == returning the class itself instead of true/false? That shouldn''t be
2006 Nov 10
3
Stubbing Time.now in trunk
I''m a big fan of stubbing Time.now so it returns a known value. I used to be able to use stubba and say: @time_now = Time.parse("Jan 1 2001") Time.stubs(:now).returns(lambda{@time_now}) However, something in trunk broke that. Fine, rspec''s got its own stubbing lib now, so I tried switching to that: @time_now = Time.parse("Jan 1 2001")
2006 Nov 06
1
Integration testing: coupling of get and post on forms
This is such a vague request it''s not even worthy of a ticket, but: When rspec does support integration testing, it''d be really nice to be able to do things like this plugin does for standard Rails tests: http://www.jasongarber.com/articles/2006/10/24/easier-testing-of-forms-form_test_helper In a nutshell, it finally closes the loop between "the empty form sent by a
2006 Nov 07
1
RSpec/Selenium start_browser_once patch?
The 0.7.0 vendor/selenium/README.txt references a "start_browser_once.patch" file. This doesn''t seem to be included in either the rspec or selenium-rc distributions, and Google finds nothing... where might I find that patch? Jay Levitt
2007 Sep 06
5
Removing/overriding/unstubbing a stub?
We''re using Mocha stubs to stub out a slow-performing network request in a Test::Unit class. But naturally, we don''t want to stub it out in the few tests that actually verify the functionality of that network request. Is there a way to do the stub in "setup", but override it for the few tests that need the original functionality? (I realize that in this case, the
2007 Sep 16
10
I lost the RSpec fight
I''ve been working on a Rails project with one other developer; he was using Test::Unit, and I was using RSpec. That works OK for a while, but obviously it starts causing pain when you have to check in two places to see if a piece of code is properly tested/spec''d, you can''t use TextMate shortcuts to switch back and forth between code and test, you have to duplicate
2007 Oct 15
14
Top Quoting?
Sort of off-topic and don''t mean to complain, but many on this list use top quoting. That works ok if you don''t quote the whole previous thread. However, I''m finding that scrolling forever to locate the reply on longer threads is getting tedious. What''s the rationale for top-quoting? Thx.
2007 Sep 20
4
alias :calling :lambda
Sprinkling my examples with ''lambda'' has always seemed like a bit of a wart to me. I''ve gotten into the habit of adding ''alias :calling :lambda'' to my spec suites. My examples then look like: calling { Foo }.should raise_error calling { Bar }.should_not raise_error Is there a reason that RSpec core has chosen not to make exception expectations more
2007 Sep 04
16
Failure Messages in RSpec
Having used JUnit and Test::Unit, I''m quite used to having the ability to insert a failure message, which helps when tests fail. For instance, the example RSpec that is generated for a model class specifies that the model class is valid. Assuming this were supposed to be true, and it failed, I''ve now got to duplicate the code in the test in order to find out why it
2009 Jul 02
2
[LLVMdev] LLVM and Eclipse
Tilmann Scheller <tilmann.scheller at googlemail.com> writes: [snip] > It might be worth to put an Eclipse CDT project file with relative > paths to the header files in the LLVM SVN repository to make it easier > for people to use Eclipse in the future (my project files currently > contain absolute paths, so they're probably not useful to other > people). CMake can
2013 Jul 17
1
[LLVMdev] eclipse and gdb
On Jul 17, 2013, at 1:19 PM, Tilmann Scheller <tscheller at apple.com> wrote: > I actually never did a build with Eclipse, only used it for code navigation and debugging :) Actually that’s not really true, I did build with Eclipse from time to time to get all the sources TableGen generates automatically. This is really nice because the source navigation works just fine across handwritten
2013 Jul 16
3
[LLVMdev] eclipse and gdb
On 07/16/2013 05:21 AM, Tilmann Scheller wrote: > Hi Reed, > > I’ve used Eclipse for a long time to do LLVM development on Linux (both for code navigation/editing and debugging), any recent Linux distribution and version of Eclipse should be fine (even older versions should be good enough as this has been working for many years). > > Xcode works fine as well, I started to use Xcode
2011 Apr 05
0
[LLVMdev] GSoC 2011: Fast JIT Code Generation for x86-64
Hi Viktor, On Tue, Apr 5, 2011 at 9:41 PM, Óscar Fuentes <ofv at wanadoo.es> wrote: > Jim Grosbach <grosbach at apple.com> writes: > > >> To me, increasing coverage of the FastISel seemed more involved than > >> directly emitting opcodes to memory, with a lesser outlook on > >> reducing overhead. > > > > That seems extremely unlikely.