0

I'm trying to build a gem that adds some methods to another gem. In this case, the gem on top of which I am building is cancancan. I'm concerned, since I'll be including new methods into the CanCan::Ability module that interact with existing CanCan components, that I could potentially break something serious in CanCan's code which could be otherwise caught in rspec tests. Ideally, the existing suite of tests for cancancan could be run inside my gem's suite of tests after the CanCan::Ability module has been modified by my gem.

How would I go about includin the suite of cancancan tests into my own gem, so that I can run cancancan's tests in addition to my own?

csm2115
  • 31
  • 1
  • 3
  • fork the `cancan` gem repository and then make your changes, add your tests and run the test suite as a whole. – engineersmnky Jun 30 '15 at 16:41
  • My concern in that case is that I'd be tied to testing that one version of `cancancan` that I had forked. It would require continually pulling in any new changes in the cancancan project, rather than setting up something that would optimally just run against the latest version (or whatever was specified/restricted by the gemspec) – csm2115 Jun 30 '15 at 17:58
  • 1
    If you keep the spec files for your gem named separately to the ones in the cancancan gem then pulling them in each time should not be more onerous than working on any other library with more than on author, and probably less than most of those. If you're specific about the latest version you support you could also just pull in the tag for that and wait for releases. – ian Jun 30 '15 at 18:10

0 Answers0