Rick DeNatale
2010-Apr-19 15:46 UTC
[rspec-users] Anyone used RSpec to write specs for rake tasks?
I released a new gem this past weekend which adds a new rake task for Jeweler to generate a release announcement. I was lazy and didn''t write any specs, mostly because I couldn''t quickly come up with a reasonably way to write a spec for a rake task. I was wondering if anyone had done some kind of testing harness for Rake tasks with RSpec. I tried googling but kept coming up with stuff about using the rake tasks provided by RSpec. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale
Pat Maddox
2010-Apr-19 21:13 UTC
[rspec-users] Anyone used RSpec to write specs for rake tasks?
Put the interesting bits in a basic Ruby class and test that, then make the Rake tasks a very thin layer over the class. On Apr 19, 2010, at 8:46 AM, Rick DeNatale wrote:> I released a new gem this past weekend which adds a new rake task for > Jeweler to generate a release announcement. > > I was lazy and didn''t write any specs, mostly because I couldn''t > quickly come up with a reasonably way to write a spec for a rake task. > > I was wondering if anyone had done some kind of testing harness for > Rake tasks with RSpec. I tried googling but kept coming up with stuff > about using the rake tasks provided by RSpec. > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Github: http://github.com/rubyredrick > Twitter: @RickDeNatale > WWR: http://www.workingwithrails.com/person/9021-rick-denatale > LinkedIn: http://www.linkedin.com/in/rickdenatale > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Jay McGaffigan
2010-Apr-19 21:50 UTC
[rspec-users] Anyone used RSpec to write specs for rake tasks?
In the source for rspec there is an spectask class and spectask_spec spec for it. That might give you what you are looking for Jay On Apr 19, 2010, at 5:13 PM, Pat Maddox <mailinglists at patmaddox.com> wrote:> Put the interesting bits in a basic Ruby class and test that, then > make the Rake tasks a very thin layer over the class. > > > On Apr 19, 2010, at 8:46 AM, Rick DeNatale wrote: > >> I released a new gem this past weekend which adds a new rake task for >> Jeweler to generate a release announcement. >> >> I was lazy and didn''t write any specs, mostly because I couldn''t >> quickly come up with a reasonably way to write a spec for a rake >> task. >> >> I was wondering if anyone had done some kind of testing harness for >> Rake tasks with RSpec. I tried googling but kept coming up with >> stuff >> about using the rake tasks provided by RSpec. >> >> -- >> Rick DeNatale >> >> Blog: http://talklikeaduck.denhaven2.com/ >> Github: http://github.com/rubyredrick >> Twitter: @RickDeNatale >> WWR: http://www.workingwithrails.com/person/9021-rick-denatale >> LinkedIn: http://www.linkedin.com/in/rickdenatale >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Joseph Wilk
2010-Apr-20 20:14 UTC
[rspec-users] Anyone used RSpec to write specs for rake tasks?
On 19/04/2010 22:13, Pat Maddox wrote:> Put the interesting bits in a basic Ruby class and test that, then make the Rake tasks a very thin layer over the class. > > > On Apr 19, 2010, at 8:46 AM, Rick DeNatale wrote: > > >> I released a new gem this past weekend which adds a new rake task for >> Jeweler to generate a release announcement. >> >> I was lazy and didn''t write any specs, mostly because I couldn''t >> quickly come up with a reasonably way to write a spec for a rake task. >> >> I was wondering if anyone had done some kind of testing harness for >> Rake tasks with RSpec. I tried googling but kept coming up with stuff >> about using the rake tasks provided by RSpec. >>I tend to do what Pat suggested with Rspec. In Cucumber I''ve had cases where I really wanted to run a rake task directly. This was pretty easy: http://gist.github.com/373000 -- Joseph Wilk http://blog.josephwilk.net http://www.songkick.com +44 (0)7812 816431>> -- >> Rick DeNatale >> >> Blog: http://talklikeaduck.denhaven2.com/ >> Github: http://github.com/rubyredrick >> Twitter: @RickDeNatale >> WWR: http://www.workingwithrails.com/person/9021-rick-denatale >> LinkedIn: http://www.linkedin.com/in/rickdenatale >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > >-- Joseph Wilk http://blog.josephwilk.net -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100420/89ee6af3/attachment.html>