similar to: Missing methods

Displaying 20 results from an estimated 100 matches similar to: "Missing methods"

2008 Jan 31
4
reby-debug and rspec
How do I use the ruby debugger with a specific test (not the whole spec file)? I want to do something like this. $ rdebug spec/models/user_spec.rb -s "should error if not new_record" ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search.
2008 Feb 19
3
render_to_string in a controller test?
Hi all, I know that in general, view and controller tests should be isolated, such that controller specs don''t test views etc. However, I think I''ve run into a situation that might be an exception. My controller uses render_to_string to produce a chunk of HTML that it passes to a model to be processed. The controller then redirects the user to a different page. The
2008 Jan 31
1
RSpec and the Basecamp API
I realise that this is kind of a basic question but I''m new to rspec and still trying to work out how to do things. I''m working on a rails project that requires basecamp integration via the api, which is fairly trivial to use via the basecamp.rb wrapper: Connection: basecamp = Basecamp.new(APP_CONFIG[''api_host''], APP_CONFIG[''api_username''],
2008 Jan 27
8
Textmate RSpec Bundle ''it'' snippet
It seems to me that the RSpec bundle''s ''it'' snippet is in need of some love. By default, a newly inserted spec passes. This seems odd as it is misleading. It also makes it harder find what specs still need to be completed if you return to an RSpec module after a break. I propose that the ''it'' snippet is changed to the following: it
2008 Mar 08
10
rspec groups?
One of the things I really liked about TestNG was the grouping feature. Are there any plans for rSpec to incorporate that? Is there any way to emulate that functionality in rspec? Will.
2008 Mar 17
4
RSpec''ing model association callbacks
Hi all, i''m learning rspec and i must admit i really love it. But at the time i started learning it, i already developed my models classes and their callbacks. Now i''m trying to get a 100% coverage of my code but i cannot reach it because i do not understand how to spec my callbacks. Look at this for example: ----------------- User Model class User < ActiveRecord::Base
2007 Dec 20
19
Story runner rake task
What''s the status on a rake task for the story runner. If nothing is in progress, where could I start to try and build one? JD
2008 Mar 13
3
Stories (well, integration tests) which aren''t plain text
Hi, Having just played with getting my first plain text story working, I like how it all fits together. It worked out nicely. However, I don''t feel our project needs to have stories as plain text, in fact it''s a slight hindrance for us. Is there any sensible mechanism for doing integration testing using rspec without plain text stories? Thanks, Rob
2011 Dec 29
1
Cholesky update/downdate
Dear R-devel members, I am looking for a fast Cholesky update/downdate. The matrix A being symmetric positive definite (n, n) and factorized as A = L %*% t(L), the goal is to factor the new matrix A +- C %*% t(C) where C is (n, r). For instance, C is 1-column when adding/removing an observation in a linear regression. Of special interest is the case where A is sparse. Looking at the
2007 Aug 18
12
Test::Unit to RSpec
So I''ve just started working on a rails project which currently has something like 7500 LOC. All of the tests are written in Test::Unit, although the test coverage is pretty poor: rcov says that 25% of the code is covered, while rake stats shows the code to test ratio as 1:0.1 (800 lines of test code). I guess I''m wondering what would generally be advisable here. Is it
2007 Jun 12
8
rdebug spec ?
Can you run rdebug on specs? I get errors when I try: $ rdebug spec ./spec/models/select_option_spec.rb ./spec: Is a directory - ./spec (Errno::EISDIR) from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ rdebug:136:in `debug_load'' from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ rdebug:136 from /opt/local/bin/rdebug:16:in `load''
2007 Dec 09
1
[rspec-devel] rspec_on_rails (trunk - r3070) works with Rails 2.0.1
I figured most of it out. The Spec::Rails stuff was something in the code which has been fixed by revision 3099. The test methods partially make sense. Since the test/unit code has been integrated, methods with test in them are automatically turned into specs. However, the test? method is in a lib file that isn''t directly loaded into the specs. It is a convenience method: def
2008 Jan 10
21
Shoulda
Hey, we''re currently using shoulda (http://dev.thoughtbot.com/ shoulda/) on a project and I saw some things that would be really nice to see in rspec, namely the should_ methods, and especially the should_be_restful method. Do these go against the rspec goals at all? Or could an ambitious programmer go to town implementing these for rspec_on_rails? Nathan Sutton fowlduck at
2008 Mar 18
6
Problem with mocking a simple has_many relationship
Hi there all. Sorry if the question sounds silly but i''m rather new at the ''mocking'' stuff... So here is my problem (code helps more than talking): the model: class Item < ActiveRecord::Base ... has_many :images, :dependent => :destroy ... protected def validate errors.add(:images, "cannot be empty") if self.images.count end end the
2007 Oct 04
5
Specs and Libs
How would I go about writing specs for a lib, particularly one with all protected and private methods. I''m trying to spec the AuthenticatedSystem library from the rails restful_authentication plugin: http://pastie.caboo.se/103625 Also, when you''re mocking objects, a side-effect is helping you define the api of the object. Is there a way to get all the behaviors that
2005 Dec 17
1
How to use validation with aggregation (composed_of)?
At the risk of being banned for posting the same question twice, I thought I''d try once more with a question for the title rather than a statement (on the basis that perhaps questions get answered and statements ignored ;-) ) ActiveRecord supports composed_of for value objects which is fantastic but one thing that it doesn''t seem to support (or at least I am unable to
2007 Oct 16
10
Scenarios Plugin Pre-Announcement
This is sort of a pre-announcement for a Rails plugin my friend Adam Williams and I are working on. We''re in the process of extracting it from a project we are working on so that it can be generally useful to the Rails community. We are calling it "Scenarios". It is a drop in replacement for Rails fixtures: http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README
2011 Aug 27
1
[PATCH 2/3] Fix use of uninitialized variable
Credit goes to "cppcheck". Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com> --- drivers/mge-utalk.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mge-utalk.c b/drivers/mge-utalk.c index c6114c7..616e2ad 100644 --- a/drivers/mge-utalk.c +++ b/drivers/mge-utalk.c @@ -465,7 +465,8 @@ void upsdrv_shutdown(void) { char
2006 May 16
9
Date transform
hi all, i want my users to enter a date in "ddmmyyyy" format, do someone know how may i transform it in "yyyy-mm-dd" in the controler before i add it to the base please? thks irong -- Posted via http://www.ruby-forum.com/.
2007 Dec 17
14
Change in isolation behaviour 1.08 - 1.10 ?
Hi, I just moved from 1.08 to 1.10 and now have one example failing, which, under 1.08, passed. Is the due to a change in behaviour? Here''s my spec (removed some passing examples) require File.dirname(__FILE__) + ''/../spec_helper'' describe "A user" do before(:each) do @user = User.new @valid_user = User.new( :email =>