How to start write test for gems?

I have some experience with testing Rails application using Rspec.

But now i tried to write tests for simple gem:

I know it will not be easy, but i want to learn this. Could you give me
some tips or send some links how to started or example of good simple
tests in gems because this is i think much more difficult then testing

What should i test first?
In first spec i think I should check Agent class?


But this spec of course fails.

    @@ -1,2 +1,19 @@
   +   @headers={},

I would like to learn how to get access to this variables like @host
@builder and how to test each one. Any tips?

Thanks in advance