2015-12-10 73 views
1

從4.1升級到4.2.0後,我得到undefined define_enum_for method error未定義的方法define_enum_for RSpec :: ExampleGroups

有沒有解決這個問題?

滑軌:4.2.0

紅寶石:紅寶石2.1.5p273(2014-11-13的修訂48405)[i686的Linux的]

1) Recording 
    Failure/Error: 
     should define_enum_for(:state). 
     with({ 
      initial: 'initial', 
      running: 'running', 
      stopped: 'stopped' 
     }) 

    NoMethodError: 
     undefined method `define_enum_for' for #<RSpec::ExampleGroups::Recording:0x99a0ea8> 

shoulda-matchers#define_enum_for

回答

0

指定test_framework :rspec爲早該-matchers#配置解決了這個問題。

shoulda-matchers#configuration

Shoulda::Matchers.configure do |config| 
    config.integrate do |with| 
    with.test_framework :rspec 

    with.library :active_record 
    with.library :active_model 
    with.library :action_controller 
    end 
end 
相關問題