search for: chrisjroos

Displaying 20 results from an estimated 23 matches for "chrisjroos".

2006 Jul 24
6
Mocking causes empty specification blocks
I''ve found myself mocking out a published api in my set-up method. This has led to some contexts having a large set-up and empty specifications. As the mocks get auto-verified, the specification blocks have nothing to do but serve as documentation. Does this sound bad? Chris
2006 Sep 25
3
Problem stubbing instances referred to by constants
Hi James, An instance retains its mocha between tests if that instance is pointed to by a constant. The simplest failing test is something like (add as a new file in mocha/test).. #--code-- require File.join(File.dirname(__FILE__), "test_helper") require ''stubba'' class WemStubbaTest < Test::Unit::TestCase Arr = [1, 2, 3] def test_a
2006 Sep 01
8
Worker suicide
Hi the list people, hi Ezra, I just read from this message http://rubyforge.org/pipermail/backgroundrb-devel/2006-July/000134.html that BackgrounDRb will offer a way to kill a worker from within itself. As this message is from 7/25, I wonder if this feature has been added since. If not, is there any way to do it? I tried this: MiddleMan.delete_worker(@_job_key) But it raise: uninitialized
2006 Jul 24
2
Creating a ''default'' mock
Am I correct in thinking that it''s not currently possible to have a method that creates a ''standard'' mock (i.e. a mock that has defaults useful in all contexts)? I''ve tried with the mock method and also by manually creating new Mock instances. I get failures when setting up expectations (undefined method ''receive'' for proc). Chris
2006 Jul 27
3
Subversion library for RoR
Hi everybody, Is there a gem or something for working directly with Subversion from a RoR app? Thanks, Tiffani A.B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060727/26846e72/attachment-0001.html
2006 Jul 15
5
Textmate command to display Active Record object attributes
I hacked together a command for textmate that displays Active Record object attributes in a tooltip. Just thought others might find it useful. Chris [1] http://blog.seagul.co.uk/articles/2006/07/14/textmate-command-to-display-active-record-column-attributes
2006 Oct 26
3
reply-to address of this list
Could one of the admins maybe specify the reply-to address for this mailing list? It''s frustrating to realise you''ve just sent a message to an individual, having meant to send to list. Chris
2006 Jul 31
1
Textmate command to display specifications
I''ve added a command that displays the html formatted output of some specifications. It''s as simple as.. #!/bin/sh /usr/bin/env spec $TM_FILEPATH -fhtml I''m wondering if anyone has anything more sophisticated (although to be fair, this does the job for now)? I''ve seen some posts about a rspec on rails textmate command but haven''t taken a look at it
2006 Jul 18
2
Testing which RuntimeError is raised
I am just starting to use unit testing. Way cool. But I am not finding very clear docs on assert_raise. I have managed to write a test that tells me that the destroy I am trying to test fails with a RuntimeError (as it should). However, I would really like to test that it rails for the specific reason I have in my model. How can I get more specific? Am I going to have to create my own exception
2006 Aug 16
5
too many SESSIONS?
I just notices my app was down, and in the log file were lots of these: No space left on device - ../config/../tmp/sessions//ruby_sess.898b1cf95e14f8e3 So i figured that i had too many sessions. I went through and deleted the sessions and then in a few minutes, the site was back up again. Can anyone explain this? Did I do the right thing? Is there a way I can tell my app to accept more
2007 Jan 23
2
SslRequirements plugin and mocha
Hi. I''m loving mocha but have ran into a problem with using the mocha plugin with a project that has the SslRequirement plugin. It seems there is some conflict between the two? Any ideas? $ ruby test/functional/calendar_controller_test.rb /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:478:in `const_missing'': uninitialized constant
2006 Jul 19
5
weird result for a custom attr reader!
Hi all, I am having a weird problem reading a value from my model. basicaly, I have these two models: class Category < ActiveRecord::Base acts_as_tree :order => "name" belongs_to :item_type has_many :specific_category_names end and class SpecificCategoryName < ActiveRecord::Base set_table_name "Specific_category_names" has_many :products belongs_to
2006 Sep 12
4
ActiveRecord Validations - validates_uniqueness_of
Hello, I''m wanting to use Mocha and Stubba for my tests in place of the default Rails testing with fixtures. I have the following class: class Person < ActiveRecord::Base validates_uniqueness_of :email end and am wondering how I can test to ensure that the validates_uniqueness_of validation is running. Any ideas? -Jonathan
2007 Jan 11
4
counter-intuitive behaveour when passing a proc to Mocha::Expectation#returns
Let''s say that I have a procedure that: * gets the number of bytes to write into some file * and returns the number of successfully written bytes def save( text, len ) This procedure is being used all over the place especially inside the method "process" which I want to test. Thus in order not to polute my filesystem I stub the "save" procedure. But of course in
2006 Jul 13
0
Trac currently not accepting new tickets
I''m trying to post a patch and trac is erroring with... --trac error output -- Traceback (most recent call last): File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 314, in dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 199, in dispatch resp =
2006 Sep 05
0
Upgrading backgroundrb problems
I just ran into the same problem as James Hughes (thread "Rake tasks fail silently, how to debug?"). I''m wondering if the rake backgroundrb:setup task should always overwrite the script/backgroundrb files to be on the safe side. Or at least warn that some already exist. Maybe there''s a way to be noisy if the backgroundrb:start task doesn''t actually start a
2006 Sep 05
0
connection closed when creating workers with the same key
Hi, I was just creating some new workers (MiddleMan.new_worker) with the same job_key. The first worker for a given key is created correctly. Any subsequent requests to create and greeted with the ''connection closed'' error. I realise that it''s not possible to have two workers with the same key, but maybe a friendlier error message is in order. Chris
2006 Sep 05
0
File processing implementation question
Hi, I''m wanting to upload a text file to the server that is processed from a backgroundrb worker. I currently have it working but I''m wondering if there are any recommended approaches for this kind of work? My approach is currently to write the uploaded file to a known place on disk. I pass the filename to my worker which then reads, processes and deletes the file. Are there
2006 Sep 05
1
environment config parameter
Am I correct in thinking that this is no longer required? The only place I could see it used (script/start) was commented out. Chris
2006 Jul 25
0
Some specs
Hi, I''d really appreciate someone looking at some specifications I have. The context in each case is realised in the setup block (I''m assuming this is standard practice?). The specifications should be self-explanatory. I''m wondering if anyone can see anything obviously bad/wrong with what I have? I''m intentionally not stating anything else as in theory the