[rspec-users] Test for a gem/plugin?

James Byrne lists at ruby-forum.com
Tue Dec 9 14:06:26 EST 2008

I have decided that for now I am going to use the authlogic gem to
provide authentication for the project I am creating.  The question
arises, since authentication is a user feature request and since it is
to be satisfied through the use of a gem (not a plugin) then should one
test for the availability of the gem or not?

Secondly, given that a gem is providing the authentication logic (and is
not my code which therefore should not be tested by me) then what should
one test for with respect to the specific implementation?  The existence
of particular attributes?  The existence of a users model?

Does one write step definitions (assuming rspec) like:

When /users are authenticated/ do
  #TODO: This does not work even when the model class exists.
  User.should exist

When /authentication by authlogic/ do
  #TODO: Find out how to test for a loaded gem within an application
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list