Re: [rspec-users] Noob syntax questions regarding rspec book...

2009-07-07 Thread ssmithstone
I to am in the same situation and the meaning of the /^ $/ is a regular expression so it matches yours features so in your features is you do Give some random text I guess some more random test the code would run against that given method, hope that makes sense and that's my view of the code On

Re: [rspec-users] Noob syntax questions regarding rspec book...

2009-07-07 Thread Ben Mabey
Rick DeNatale wrote: On Tue, Jul 7, 2009 at 11:35 AM, Chris Sund wrote: Hey Everyone, I've been working my way through the Rspec book trying to absorb and understand everything. This is my first time with BDD and I'm just trying to figure out some simple syntax stuff. My questions revolve ar

Re: [rspec-users] Noob syntax questions regarding rspec book...

2009-07-07 Thread Rick DeNatale
On Tue, Jul 7, 2009 at 11:35 AM, Chris Sund wrote: > Hey Everyone, > > I've been working my way through the Rspec book trying to absorb and > understand everything. This is my first time with BDD and I'm just > trying to figure out some simple syntax stuff. My questions revolve > around some of the

Re: [rspec-users] Noob syntax questions regarding rspec book...

2009-07-07 Thread David Chelimsky
On Tue, Jul 7, 2009 at 10:35 AM, Chris Sund wrote: > Hey Everyone, > > I've been working my way through the Rspec book trying to absorb and > understand everything. This is my first time with BDD and I'm just > trying to figure out some simple syntax stuff. My questions revolve > around some of the

Re: [rspec-users] Noob syntax questions regarding rspec book...

2009-07-07 Thread Yi Wen
They are regex. On Jul 7, 2009, at 10:35 AM, Chris Sund wrote: Hey Everyone, I've been working my way through the Rspec book trying to absorb and understand everything. This is my first time with BDD and I'm just trying to figure out some simple syntax stuff. My questions revolve around some of

[rspec-users] Noob syntax questions regarding rspec book...

2009-07-07 Thread Chris Sund
Hey Everyone, I've been working my way through the Rspec book trying to absorb and understand everything. This is my first time with BDD and I'm just trying to figure out some simple syntax stuff. My questions revolve around some of the syntaxing used in the book. These are really simple questions

Re: [rspec-users] should_receive with a block

2009-07-07 Thread doug livesey
Hi -- cheers for that. I've taken your advice (the 1st approach). ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Rails] Controller testing problem

2009-07-07 Thread Zach Moazeni
Bleh, I forgot to mention, if you have to maintain controller action code that is dependent on instance variables set elsewhere, here is a ruby hack that will allow you to setup the context. (Please note, I recommend refactoring the code under test but I understand sometimes the precondit

Re: [rspec-users] [Rails] Controller testing problem

2009-07-07 Thread Zach Moazeni
Hey Ignacy, I think I'm in the minority on this one, but I tend to keep my action logic independent of filters. Doing that, my typical controller spec begins like this: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/.

Re: [rspec-users] should_receive with a block

2009-07-07 Thread Zach Moazeni
Hey Doug, That won't work because of how Ruby handles the equality of lambdas/ procs. From my experience there are 2 approaches. 1) Test both the "call" and the block together. So instead of mocking Util, mock SfProperty. or 2) Store the lambda somewhere (like a Class variable). Test the

[rspec-users] should_receive with a block

2009-07-07 Thread doug livesey
Hi -- can I specify the block that should be called with a method? Sort of like this: it "should bulk update the properties_params in groups of 50" do block = lambda do |params| SfProperty.put( :bulk_update, :sf_properties => params ) end Util.should_receive( :do_to_