[rspec-users] Custom Example Groups

2009-04-18 Thread Brandon Olivares
Hi, I want to build a custom example group, but there really aren't any examples anywhere for how to do so. The new chapter in The RSpec Book talks about it, but doesn't actually show an example, only how to register it. Looking at rspec-rails, I can see a pattern, but I don't know if that's spec

Re: [rspec-users] How to approach testing automated processing

2009-04-18 Thread James Byrne
Zach Dennis wrote: > On Sat, Apr 18, 2009 at 7:02 PM, James Byrne > wrote: >> �To Reduce Costs and Protect Revenue >> I should construct the feature step definitions and how I would test >> this. �I figure I just have to take as given that cron works because >> that is not my code. �But how best

Re: [rspec-users] How to approach testing automated processing

2009-04-18 Thread Ben Mabey
Zach Dennis wrote: On Sat, Apr 18, 2009 at 7:02 PM, James Byrne wrote: I have a requirement to fetch a data feed from our central bank and set a variety of currency exchange rates from that feed. My question is how does one approach behavioural driven design with autonomous automated process

Re: [rspec-users] How to approach testing automated processing

2009-04-18 Thread Zach Dennis
On Sat, Apr 18, 2009 at 7:02 PM, James Byrne wrote: > I have a requirement to fetch a data feed from our central bank and set > a variety of currency exchange rates from that feed. My question is how > does one approach behavioural driven design with autonomous automated > processing? What I start

Re: [rspec-users] DDL Rails 2.3 nested transactions causing problems in specs

2009-04-18 Thread Zach Dennis
On Fri, Apr 17, 2009 at 6:36 PM, john wrote: > Mysql::Error: You have an error in your SQL syntax; check the manual that > corresponds to your MySQL server version for the right syntax to use near > 'RELEASE SAVEPOINT active_record_1' at line 1: RELEASE SAVEPOINT > active_record_1 > a rails ticket

[rspec-users] How to approach testing automated processing

2009-04-18 Thread James Byrne
I have a requirement to fetch a data feed from our central bank and set a variety of currency exchange rates from that feed. My question is how does one approach behavioural driven design with autonomous automated processing? What I started with is this: Feature: Automatically Retrieve and Store F

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly specing

2009-04-18 Thread Lenny Marks
On Apr 18, 2009, at 1:17 PM, Fernando Perez wrote: Hi, Let's take the example of the depot app. In my controller I set @order. Then in the view comes the bad stuff: @order.items.each do |item| item.product.title end Now I'm having problems specing item.product.title. A quick and dirty fi

Re: [rspec-users] specs for attributes with default values on the SQL layer

2009-04-18 Thread Stephen Eley
My question is, why bother? Unless I'm missing something, testing for the existence of an error that your code will never provide sounds backwards. Instead test that you DON'T get an error when the required value isn't explicitly supplied, to confirm that the default works. (Although, really, the

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly specing

2009-04-18 Thread Mark Wilden
On Sat, Apr 18, 2009 at 10:17 AM, Fernando Perez wrote: > > @order.items.each do |item| >  item.product.title > end > > Now I'm having problems specing item.product.title. A quick and dirty > fix is to trade a for for an underscore, so I create Item#product_title: > > def product_title >  product.

[rspec-users] Depot app, Demeter's law and troubles cleanly specing

2009-04-18 Thread Fernando Perez
Hi, Let's take the example of the depot app. In my controller I set @order. Then in the view comes the bad stuff: @order.items.each do |item| item.product.title end Now I'm having problems specing item.product.title. A quick and dirty fix is to trade a for for an underscore, so I create Item#p

Re: [rspec-users] specs for attributes with default values on the SQL layer

2009-04-18 Thread Pat Maddox
On Sat, Apr 18, 2009 at 3:09 AM, svoop wrote: > Pat Maddox writes: >> Okay I must be dense because I'm not sure what you mean by it gets in >> the way of refactoring. > > Actually, scratch that, because... > >> And you're right about how it behaves...that's exactly how default >> attrs work.  If

Re: [rspec-users] specs for attributes with default values on the SQL layer

2009-04-18 Thread svoop
Pat Maddox writes: > Okay I must be dense because I'm not sure what you mean by it gets in > the way of refactoring. Actually, scratch that, because... > And you're right about how it behaves...that's exactly how default > attrs work. If you want to test that your model doesn't allow invalid >

Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-18 Thread Kero van Gelder
> I've been doing something similar. I think the benefit of having half > the steps(each can be negated) wins over the small impact it has on step > readability. Personally I started adding stuff like this(perhaps not as > DRY but simple enough): > > Then /^the correspondence should (not )?have

Re: [rspec-users] [cucumber, jruby] Same steps are being added multiple t

2009-04-18 Thread Aslak Hellesøy
Aslak Hellesøy wrote: On Tue, Apr 14, 2009 at 12:08 AM, John Goodsen wrote: OK, I'll reproduce in a simple example and create a ticket... Excellent - I'll get to it ASAP I am also having the same issue with cucumber-java. please refer - http://www.ruby-forum.com/topic/184342#new With

Re: [rspec-users] But rspec can not be found

2009-04-18 Thread Tom Stuart
On 18 Apr 2009, at 05:08, David Chelimsky wrote: I'm not sure that requiring environment.rb is the right solution because it will be loaded no matter what rake task is invoked, and that is clearly not the intent for all rake tasks. I hate to go back to the ugly mess that was there to add either