Re: [rspec-users] How to write a spec file for a helper

2009-04-15 Thread Matt Wynne
On 14 Apr 2009, at 16:14, Brandt Kurowski wrote: On Apr 13, 11:26 am, Pat Maddox wrote: If this is a module that you're using to extend the behavior of Numeric classes, just mix it in somewhere and write examples for the class that got the mixin. I prefer to test modules in isolation by mix

Re: [rspec-users] How to write a spec file for a helper

2009-04-14 Thread Brandt Kurowski
On Apr 13, 11:26 am, Pat Maddox wrote: > If this is a module that you're using to extend the behavior of > Numeric classes, just mix it in somewhere and write examples for the > class that got the mixin. I prefer to test modules in isolation by mixing them into a stub in the spec, in order to mak

Re: [rspec-users] How to write a spec file for a helper

2009-04-13 Thread Pat Maddox
On Mon, Apr 13, 2009 at 8:17 AM, David Chelimsky wrote: > On Mon, Apr 13, 2009 at 12:09 PM, Salil Gaikwad wrote: >> How to write a spec file for a following helper >> >> module ArtistsHelper >> >> def round_to(x) >>    (self * 10**x).round.to_f / 10**x >> end >> >> end > > in spec/helpers/artists

Re: [rspec-users] How to write a spec file for a helper

2009-04-13 Thread David Chelimsky
On Mon, Apr 13, 2009 at 12:09 PM, Salil Gaikwad wrote: > How to write a spec file for a following helper > > module ArtistsHelper > > def round_to(x) >    (self * 10**x).round.to_f / 10**x > end > > end in spec/helpers/artists_helper_spec.rb: describe AristsHelper do it "rounds to " do

[rspec-users] How to write a spec file for a helper

2009-04-13 Thread Salil Gaikwad
How to write a spec file for a following helper module ArtistsHelper def round_to(x) (self * 10**x).round.to_f / 10**x end end Regards salil -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://