Project

General

Profile

Plugin tests failing with "undefined method `stubs'"

Added by Harry Garrood almost 12 years ago

Here's an excerpt from a patch for SettingsController for my plugin:

test 'doesnt break other plugin settings' do
  # mostly copied from SettingsControllerTest
  Setting.stubs(:plugin_foo).returns({'setting' => 'value'})

This is raising a NoMethodError. I can't understand why, because the file this is in is requiring my plugin's test_helper, which is in turn requiring Redmine's test_helper -- surely Object#stubs should be defined if this is the case?


Replies (1)

RE: Plugin tests failing with "undefined method `stubs'" - Added by Harry Garrood almost 12 years ago

Solved -- I had done

bundle install --without=test
D'oh!

    (1-1/1)