On Mon, Feb 2, 2009 at 10:36 PM, Phlip <phlip2...@gmail.com> wrote:
> Pat Maddox wrote:
>
>> I'll blame Merb on the basis that there is no "inherit" in RSpec.  I'm
>> guessing it's some kind of merb extension.
>
> http://blog.davidchelimsky.net/2007/4/1/rspec-plays-nice-with-others
>
> I know I know - time flies!
>
> If it has been superseded, then how do you inject a batch of assertions
> defined in someone else's class into RSpec?

module MyMethods
  # define matchers
end

Spec::Runner.configure do |c|
  c.include MyMethods
end

That will include the module in every example group, regardless of the
base class.

>
> For example, how does RSpec on Rails import its ActiveSupport::TestCase
> assertions?
>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to