[rspec-users] rspec --drb --port

2009-09-24 Thread Chris Flipse
Hey, I'm having a bit of a Works For Me(tm) problem with my patch to rspec. The idea of the patch is to allow specifying a non-default port for the --drb option to connect to. I got the matching patches into Cucumber and Spork already, and I would like to get this out in RSpec as well. It Works

Re: [rspec-users] [ANN] rspec-rails 1.2.9 Released

2009-10-06 Thread Chris Flipse
rubyforge seems to have picked up the rspec release, but not the rspec-rails release -- the web interface (at least) still says that the most recent rspec-rails is 1.2.7.1 On Tue, Oct 6, 2009 at 12:08 AM, David Chelimsky wrote: > rspec-rails version 1.2.9 has been released! > > *

Re: [rspec-users] [ANN] rspec-rails 1.2.9 Released

2009-10-06 Thread Chris Flipse
Oh, I see it. Thanks; scanned right past it... On Tue, Oct 6, 2009 at 9:56 AM, David Chelimsky wrote: > On Tue, Oct 6, 2009 at 8:52 AM, Chris Flipse wrote: > > rubyforge seems to have picked up the rspec release, but not the > rspec-rails > > release -- the web interface (at

Re: [rspec-users] HTML array problem

2009-12-03 Thread Chris Flipse
Your first attempt is the correct way to go about it post 'comments/rate', :id=>4, :score=>{4=>10} However, note that in your controller, the parameters are stringified / symbolized. params["score"]["4"] will get you 10, but params["score"][4] will get you nil On Wed, Dec 2, 2009 at 8:40 AM,

[rspec-users] survey: roles in controller specs

2010-05-11 Thread Chris Flipse
I have a bit of a question on how people are organizing their controller specs, once you take user roles into account. I'm not entirely sure that I've found a way to do it that feels "natural" to me. So, say I've got a controller that I want to ensure is locked down to a particular set of users.

Re: [rspec-users] How do you turn colour on in autotest?

2010-08-18 Thread Chris Flipse
Check for a .rspec file in one project, not the other. On Wed, Aug 18, 2010 at 3:45 AM, Ashley Moran wrote: > Hi > > This may sound like a really dumb question (most likely because it is), but > I have two RSpec 2 projects, and one of them gives me colour, but the other > doesn't. Nothing in sp

Re: [rspec-users] Problem running "spec spec" or "rake spec" (does nothing)

2010-08-27 Thread Chris Flipse
both rake spec and spec itself expect a spec file to be named *_spec.rb, not *.spec On Fri, Aug 27, 2010 at 12:42 PM, theLemcke wrote: > I have an unusual problem. I'm adding test coverage to my project, > and I'd like to be able to run "rake spec" to run all the tests in > the /spec folder of

Re: [rspec-users] Testing methods that yields a block

2010-10-12 Thread Chris Flipse
On Thu, Oct 7, 2010 at 10:24 AM, ignacy.moryc wrote: > I want to test a class method that sets some state and then yields a > block. It looks something like that: > > class Cat > class << self > def start > id = get_uuid > begin > yield if block_given? >

Re: [rspec-users] A recently observed anti pattern: commented out tests

2012-07-24 Thread Chris Flipse
On Tue, Jul 24, 2012 at 1:55 PM, James Cox wrote: > so yes, pending is ok, but a second keyword "broken" might be nicer, > which would act the same but output different info.-- > There is a block form of pending. It actually executes the contents of the block, but outputs as a pending test -- u

Re: [rspec-users] Cucumber: please make "gem install aslakhellesoy-cucumber" or "gem install cucumber" work again

2008-10-01 Thread Chris Flipse
On Tue, Sep 30, 2008 at 5:20 PM, aslak hellesoy <[EMAIL PROTECTED]>wrote: > On Tue, Sep 30, 2008 at 9:02 PM, Evan David Light > <[EMAIL PROTECTED]> wrote: > > Subject says most of it. I'd love to use Cucumber in my project but I > need > > to be able to install it in a Rails app and by a particul

Re: [rspec-users] Cucumber: please make "gem install aslakhellesoy-cucumber" or "gem install cucumber" work again

2008-10-01 Thread Chris Flipse
On Wed, Oct 1, 2008 at 11:20 AM, aslak hellesoy <[EMAIL PROTECTED]>wrote: > On Wed, Oct 1, 2008 at 5:11 PM, Chris Flipse <[EMAIL PROTECTED]> wrote: > > On Tue, Sep 30, 2008 at 5:20 PM, aslak hellesoy < > [EMAIL PROTECTED]> > > wrote: > >> > >

Re: [rspec-users] Cucumber step FIT-like tables

2008-10-29 Thread Chris Flipse
On Mon, Oct 27, 2008 at 2:33 PM, aidy lewis <[EMAIL PROTECTED]>wrote: > Hi, > > I am having a problem with my Cucumber step FIT-like tables. > > This is my scenario > > Scenario: Filter by new files added >Given a database update that creates an ExpiryDate that is within 30 > days >And a

Re: [rspec-users] mocking named_scope utilization

2008-11-04 Thread Chris Flipse
I dunno ... creating a bunch of joining methods seems to be an awfully disjoint way to deal with something that is, admittedly, designed to laugh in the face of the Law of Demeter. I've been handling chains through some heavy use of null_object stubs ... but, I've been doing that sort of manually.

Re: [rspec-users] mocking named_scope utilization

2008-11-04 Thread Chris Flipse
Right. Example passed a block, but stub_chains didn't call it. Pretend there's a yield(hades) in there somewhere. On Tue, Nov 4, 2008 at 10:26 PM, Chris Flipse <[EMAIL PROTECTED]> wrote: > I dunno ... creating a bunch of joining methods seems to be an awfully > dis

Re: [rspec-users] Mocking and stubbing model relationships

2008-11-19 Thread Chris Flipse
I've actually taken this old gem and enhanced it a bit module Spec::Mocks::Methods def stub_association!(association_name, methods_to_be_stubbed ={}) mock_assn = Spec::Mocks::Mock.new(association_name.to_s) stub_association_with(association_name, mock_assn, methods_to_be_stubbed) end

Re: [rspec-users] Cucumber, Webrat and http basic auth

2008-11-20 Thread Chris Flipse
Yes. I've actually had to patch webrat (behind a firewall, unfortunately) to deal with this. Havn't had a chance to actually extract from the firewall. It's not actually Webrat's fault, at least from what I've managed to uncover. The problem lies within the Rails integration tests; specifically

Re: [rspec-users] Cucumber, Webrat and http basic auth

2008-11-22 Thread Chris Flipse
10:28 AM, Josh Knowles <[EMAIL PROTECTED]>wrote: > On Thu, Nov 20, 2008 at 10:15 AM, Chris Flipse <[EMAIL PROTECTED]> wrote: > > I ended up patching webrat to avoid the post_via_redirect rails methods, > and > > had to implement a version of follow_redirects th

Re: [rspec-users] OK... What is ... fu ?

2009-01-30 Thread Chris Flipse
Think Kung-Fu It's not an abbreviation, it's a suffix that's supposed to imply a certain level of kick-assery http://catb.org/jargon/html/F/suffix-fu.html On Fri, Jan 30, 2009 at 9:49 AM, James Byrne wrote: > Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins, > gems and such

[rspec-users] [rspec] [rails] Specing a form builder

2009-02-05 Thread Chris Flipse
I'm trying to set up and run a new form builder under rails, which lives under the helpers directory, but isn't really a helper. (Not a module, so doesn't mix in well) Short of dropping down into a view spec, how do I set up to actually spec the form builder? describe RandomFormBuilder do attr

Re: [rspec-users] [rspec] [rails] Specing a form builder

2009-02-05 Thread Chris Flipse
Thu, Feb 5, 2009 at 11:05 AM, Chris Flipse wrote: > I'm trying to set up and run a new form builder under rails, which lives > under the helpers directory, but isn't really a helper. (Not a module, so > doesn't mix in well) > > Short of dropping down into a view spe

[rspec-users] [cucumber] [alpha] The Backgrounder is run without cleaning up

2009-02-10 Thread Chris Flipse
This /could/ just a screwy behavior I'm seeing in SQL lite, but I don't think so; normal scenarios are doing this just fine. I'm playing with the Background feature in the .1.99 beta, and it looks like it's being run before every feature -- but it's not cleaning up afterwards. I have a model with

Re: [rspec-users] [cucumber] [alpha] The Backgrounder is run without cleaning up

2009-02-11 Thread Chris Flipse
Okay, thanks. Wanted to check before filing a bug so I'm not throwing duplicates into the mix. On Wed, Feb 11, 2009 at 2:56 AM, aslak hellesoy wrote: > On Wed, Feb 11, 2009 at 2:10 AM, Chris Flipse wrote: > > This /could/ just a screwy behavior I'm seeing in SQL lite, but I

Re: [rspec-users] [Cucumber] ssl requirement

2009-02-17 Thread Chris Flipse
> > Ok, so I tried just sticking an "ENV['HTTPS'] = 'on'" in my > spec/spec_helper.rb file and re-running my spec suite. Looks like this is > not enough in itself, as I got about 77 spec failures, all of them > apparently caused by "ssl?" returning false and producing unwanted > redirects. > Rails

[rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
I've been going back over some legacy code, backfilling tests, and I'm encountering something that is causing no small amount of pain. This is in a mature Rails app, that's lived and migrated from 1.1 through to 2.1, so there's a lot of ancient cruft built up in the corners that I've been trying

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
On Sat, Feb 28, 2009 at 1:38 PM, David Chelimsky wrote: > On Sat, Feb 28, 2009 at 11:52 AM, Chris Flipse wrote: > > I've been going back over some legacy code, backfilling tests, and I'm > > encountering something that is causing no small amount of pain. This is &g

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
28, 2009 at 2:16 PM, David Chelimsky wrote: > On Sat, Feb 28, 2009 at 12:51 PM, Chris Flipse wrote: > > > > > > On Sat, Feb 28, 2009 at 1:38 PM, David Chelimsky > > wrote: > >> > >> On Sat, Feb 28, 2009 at 11:52 AM, Chris Flipse > wrote: > >

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
On Sat, Feb 28, 2009 at 4:34 PM, Zach Dennis wrote: > > Disclaimer, this entire post has to deal with model level > authorization and a technique I've been using and evolving in Rails > projects. It has nothing to do with your issue of global state for > what User is logged in. Onto the fun stuff

Re: [rspec-users] [rails] An authorization question

2009-02-28 Thread Chris Flipse
On Sat, Feb 28, 2009 at 3:42 PM, Ben Mabey wrote: > Chris Flipse wrote: > >> I've actually been okay with it at the unit testing / rspec level -- I've >> had it stubbed as you describe for a while. >> >> The pain point came in as I was trying to setup data

Re: [rspec-users] Spec'ing chained calls

2009-03-13 Thread Chris Flipse
You might want to look into using a null object, and breaking that first spec up into several examples (a null object returns itself when sent a message it doesn't know how to handle) http://gist.github.com/78570 I've built more than a few named_scope chains using this pattern, and it seems to w

Re: [rspec-users] How to spec a around_filter

2009-03-25 Thread Chris Flipse
I havn't done this myself, but would controller.stub!(:around_filter_method).and_yield work? On Wed, Mar 25, 2009 at 4:15 PM, Alex wrote: > Hi all, any of you guys had success specking out a around_filter? I > tried a few things like controller.should_receive > (:around_filter_method), controll

Re: [rspec-users] Running cucumber distributed across hardware

2009-04-03 Thread Chris Flipse
I'm thinking about trying to get TestJour in place to run on a single system, but one with a crapload of processors, since that's about the only way to make anything run reasonably on a Sparc ... I think I remember seeing that there was a Bonjour protocol client for Solaris, but I'm not sure where

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Chris Flipse
helper.stub! the OP is testing a helper method. On Tue, Apr 14, 2009 at 9:04 AM, Fernando Perez wrote: > Try with that: > > controller.stub!(:params).and_return({:controller => > 'your_controller_name'}) > -- > Posted via http://www.ruby-forum.com/. >

Re: [rspec-users] cucumber/webrat, need to set user in session, can't stub or mock. Fixtures?

2009-04-28 Thread Chris Flipse
I have a subapp that authenticates remotely, and pulls information from the main app using ActiveResource, and a token provided in a cookie, which sounds at least close to what you're trying to test While it's possible to stub the values coming back, it can be tricky. By definition, you pretty mu

Re: [rspec-users] Noob question

2009-04-29 Thread Chris Flipse
On Wed, Apr 29, 2009 at 7:42 AM, Korny Sietsma wrote: > Presumably you only need these if you are *building* cucumber? > > If you just want to use cucumber, it should be as simple as "gem > install cucumber", and it should get all the other dependencies. On > my machine it seemed to install tree

Re: [rspec-users] Cucumber tables

2009-05-15 Thread Chris Flipse
On Fri, May 15, 2009 at 11:35 AM, James Byrne wrote: > I cannot seem to locate any documentation on how to implement the new > table syntax otherwise I would not bother the list with this. > > I wish to write something like this: > > And we do have a forex rate for the following currency code an

[rspec-users] session id in a rails 2.3 app

2009-06-04 Thread Chris Flipse
I'm in the process of converting an application from an older version of rails to rails 2.3.2, and I'm running into some problems with my specs There's a part of the application that references the current session ID; non-optional there. It's referenced in a before filter in application_controlle

[rspec-users] specify a port for DRB

2009-08-12 Thread Chris Flipse
Pardon the crosspost, but this applies to both So, at work, I'm one of several people developing on the same multi-user unix system. I/we would like to be able to use the drb server, but at the moment rspec,cucumber and spork assume a single well known port number for drb. That doesn't work well

Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized actions

2008-04-08 Thread Chris Flipse
On Tue, Apr 8, 2008 at 10:03 AM, Giuseppe Bertini <[EMAIL PROTECTED]> wrote: > Dear all, > > I am wondering how to properly mock/stub out the preliminary steps to > actions protected by restful_authentication and acl_system2 (role-based > authorization to execute actions). Here's my setup: > I us

Re: [rspec-users] Cucumber: pending specs

2008-09-17 Thread Chris Flipse
I'm finding another case where I'll get unintended breaks, and it's not so easy to avoid as adding a PENDING to the end of a step matcher. Scenario: none of these are pending Given a completed feature # green When I submit a bad create post # green Th