views:

206

answers:

1

I've been searching around for ways to create a gem with RSpec, but haven't found descriptive tutorials.

I started out with Ryan Bates' Making a gem, but I'm looking for a tutorial that discusses creating an acts_as style gem with RSpec.

By acts_as, I mean to say that the gem adds certain methods to an existing class in Rails. Why is this important? Because I've found gem templates like New Gem, got a spec to run but when I try to test an Active Record object it starts choking. I've tried requiring active_record in spec_helper.rb but I must be doing something wrong because it doesn't solve the problem.

When it comes to plugins, I found this Rails Guide. If there's a gem version for that around that'd be awesome.

Thanks guys!

P.S. I love screencasts.

+3  A: 

I like using jeweler for starting gems.

to generate a gem skeleton with rspec

jeweler --rspec my-gem-with-rspec
BaroqueBobcat
Thanks! This is like New Gem's rspec option. What I wanted to find was a tutorial that explain what I had to include and where. I ended up guessing what to include by copying and pasting stuff from different gems, and renaming them appropriately. It was a bit more haphazard than I would have liked but I suppose there aren't full tutorials out there. Maybe I'll just write on myself.I won't pick your answer, although helpful, because it's not a tutorial. Thanks though!
Ramon Tayag
jeweler is the only thing you need to start a new gem. everything is already setup for you on the `Rakefile`.
knoopx