Forum: RSpec `add_example_group': undefined method `deprecate' for Spec:Module (NoMethodError)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
vanweerd (Guest)
on 2009-04-16 06:16
(Received via mailing list)
I'm the getting the following error when running rspec on a rails
project.

/Users/vanweerd/work2/innerplate/vendor/plugins/rspec/lib/spec/runner/
formatter/base_formatter.rb:52:in `add_example_group': undefined
method `deprecate' for Spec:Module (NoMethodError)
  from /Library/Ruby/Gems/1.8/gems/rspec-1.2.2/lib/spec/runner/
reporter.rb:14:in `add_example_group'
  from /Library/Ruby/Gems/1.8/gems/rspec-1.2.2/lib/spec/runner/
reporter.rb:13:in `each'
  from /Library/Ruby/Gems/1.8/gems/rspec-1.2.2/lib/spec/runner/
reporter.rb:13:in `add_example_group'
  from /Library/Ruby/Gems/1.8/gems/rspec-1.2.2/lib/spec/example/
example_group_methods.rb:116:in `notify'
  from /Library/Ruby/Gems/1.8/gems/rspec-1.2.2/lib/spec/example/
example_group_methods.rb:97:in `run'

The method is:
        # Deprecated - use example_group_started instead
        def add_example_group(example_group_proxy)
          Spec.deprecate("BaseFormatter#add_example_group",
"BaseFormatter#example_group_started")
          example_group_started(example_group_proxy)
        end

I'm wondering if the issue is the base_formatter.rb is referencing the
gem instead of the reporter.rb installed under the rails project
vendor/plugins/rspec directory?

This is on a rails 2.3.2 project with the restful authentication
plugin.

Thanks,
Nick
David C. (Guest)
on 2009-04-16 06:34
(Received via mailing list)
On Wed, Apr 15, 2009 at 11:10 AM, vanweerd 
<removed_email_address@domain.invalid> wrote:
>        from /Library/Ruby/Gems/1.8/gems/rspec-1.2.2/lib/spec/runner/
> "BaseFormatter#example_group_started")
>          example_group_started(example_group_proxy)
>        end
>
> I'm wondering if the issue is the base_formatter.rb is referencing the
> gem instead of the reporter.rb installed under the rails project
> vendor/plugins/rspec directory?

That's definitely the issue. May I recommend that you get rid of the
plugin and install as a gem?
Nicholas Van W. (Guest)
on 2009-04-16 22:20
(Received via mailing list)
Thanks. I did that after finding the gem section on your site.
Things look better now.

Thanks,
Nick
This topic is locked and can not be replied to.