search for: jchris

Displaying 19 results from an estimated 19 matches for "jchris".

Did you mean: chris
2007 Jun 23
4
inverse examples? (should fail)
...little less fun to pepper throughout a document). it "should do something that''s been deprecated", :inverse => true do my_object.should_receive(:deprecated_message) action end Thoughts? Does this exist already and I haven''t noticed it? -- Chris Anderson http://jchris.mfdz.com
2007 Jan 08
2
thoughts on mocks and specs
...#39;'t just a fight for DRY, but also encourages good spec design. Situations diverse enough to need separate body code could use different contexts anyway. If there is a call for this feature, I''d be happy to make a go at patching it into RSpec. Reactions? -- Chris Anderson http://jchris.mfdz.com
2007 Jan 29
0
Rails trunk breakages
...I run my specs at r6061, they all pass, and in 6062 I get a trace like this every time my controller generates a route: TypeError in ''Requesting /artists/1 using PUT should redirect to the artist'' can''t convert Fixnum into String (eval):19:in `artist_url'' /Users/jchris/ruby/rails/grabbit/config/../app/controllers/artists_controller.rb:59:in `update'' /Users/jchris/ruby/rails/grabbit/config/../app/controllers/artists_controller.rb:56:in `update'' ./spec/controllers/artists_controller_spec.rb:267:in `do_update'' ./spec/controllers/artists_co...
2006 Nov 25
2
Comparison between RSpec and test/unit
I''m curious, Christian Neukirchen has released test/unit[1] that seems to mirror much of RSpec, but built on Test::Unit, so in some ways less brittle from a Rails-integration perspective, and also allowing you to mix the two together as appropriate. So, has anyone made an informed comparison? I''m new enough that I don''t really know the finer points yet. The syntax is
2007 May 31
16
Could anyone please help with rspec/nested resource behavior checking?
My problem has been listed here: http://railsforum.com/viewtopic.php?pid=25439#p25439 Don''t think it would be required to completely re-type it here :) Thanks! -- -Daniel Fischer http://danielfischer.com - Geek Blog http://abigfisch.com - Portfolio http://writersbeat.com - Writing Community
2007 Feb 05
1
long jumping out of code in specs
...k, without going through with mocking and stubbing all the code the after_create hook uses. Stopping execution at the point where the expectation is satisfied is also appealing, in a premature optimization kind of way. Like I said, an abomination, but maybe a useful one. -- Chris Anderson http://jchris.mfdz.com
2006 Dec 08
0
RSpec impressions
...with RSpec gave me a faster library, in less time, with less code, while worrying less about code duplication. With RSpec, I build up behaviour, a little at a time, filling in the methods only when I need to. More taste, less filling. The full length of my ramblings are posted on the blog: http://jchris.mfdz.com/code/2006/12/rspec_and_recurring__schedule -- Chris Anderson http://jchris.mfdz.com
2006 Dec 13
4
RSpec and simply_helpful
Hi All I''m having some problems running my view specs when using simply_helpful. I have it semi-working via the following: module SimplyHelpfulHelper def self.included(base) base.send :include, SimplyHelpful::RecordIdentificationHelper base.send :include, SimplyHelpful::RecordTagHelper end end context "The index template" do setup do @shift =
2007 Jun 23
6
Autotest bug with rerunning passing tests?
Am I correct in remembering that autotest (with Test::Unit) would rerun all the tests if a subset of the tests passed? If so, shouldn''t this behaviour also be present in rspec''s autotest library? Scott
2006 Oct 28
5
RSpec, REST and different formats
Is anyone using RSpec with RESTful rails apps? In my rails controllers I check request.respond_to? and render different views accordingly. I noticed that the get method in the rails plugin doesn''t accept headers: controller_mixin.rb line 92 def get(action, parameters = nil) @request.env[''REQUEST_METHOD''] = ''GET'' process action,
2007 Mar 28
14
Autotest
Is anyone using rspec with autotest? Scott
2007 Feb 11
1
Specing Rails Views
Hello - I''m currently trying to write some specs for my rails views. My views depend upon the restful authentication plugin method logged_in? Like so, <% if logged_in? %> <ul id="product-admin-nav"> <dd><%= link_to "create a new product", new_product_url %></dd> </ul> <% end %> However, when I have the following
2007 Jan 15
2
heckle and rspec on rails
...ure out why, but it''s late, so I should sleep instead. I guess the question is, has anyone had luck using Heckle with Rails? I''ve got it working for regular ruby specs, and it''s a lot of fun (although I do hit infinite loops sometimes). Thanks! -- Chris Anderson http://jchris.mfdz.com
2007 Jan 30
0
nil object in mocks
...#39;', :default => 5) and if you allow the default value to be a lambda that takes the mock as an argument, you can make :null_object a special case: m = mock(''returns self'', :default => lambda{|m| m}) but now I''m just getting silly. -- Chris Anderson http://jchris.mfdz.com
2006 Oct 11
1
Retiring test2spec?
Hi all, We''re thinking about retiring the test2spec translation tool because it''s becoming a maintenance problem. Is anyone using it? Would anyone miss it if it went away? Aslak
2006 Nov 20
0
Announcing Monrel Raw Output
...with wget already have headers. Enter mongrel_raw_output. I know it''s sort of and edge case that led me to write the plugin, but I''m hoping it will come in handy for some of you. And please let me know if you have any issues or questions when using it. -- Chris Anderson http://jchris.mfdz.com
2006 Nov 22
3
Controller Isolation
Hi, I have a project that I had running under rspec 0.6.x and recently upgraded to 0.7.2. I am trying to isolate my controllers from the database as I go through and change all the specs to run under 0.7.2. I am having a problem where I need to make the create! method return the mocked object as well as raise RecordInvalid exception. Is this at all possible? I use the rescue statement in my
2007 Jan 30
5
errors while testing resource controller using rpec
I am testing a resource called venue in this piece of code (generated using script/rspec_resource) ==================== context "Requesting /venues using POST" do controller_name :venues setup do @mock_venue = mock(''Venue'') @mock_venue.stub!(:save).and_return(true) @mock_venue.stub!(:to_param).and_return(1) Venue.stub!(:new).and_return(@mock_venue)
2006 Nov 19
6
artificial sugar causes cancer
All, If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149 you''ll see that Chad (the submitter) found the source of the bug. Unfortunately, the source of *this* bug is the *solution* to a *previous bug* in which Rails was replacing RSpec''s method missing with its own. When we settled on underscores, my one reservation was