Mocha Mock Carries To Another Test

后端 未结 5 1049
无人共我
无人共我 2020-12-06 00:50

I have been following the 15 TDD steps to create a Rails application guide - but have run into an issue I cannot seem to resolve. For the functional test of the WordsContro

5条回答
  •  孤城傲影
    2020-12-06 01:36

    mocha needs to be loaded last. I struggled a lot with this problem too.

    #Gemfile
      group :test
        gem 'mocha', '~>0.9.8', :require => false
        ...
      end
    

    and

    test_helper.rb
      ....
      #at the very bottom
      require 'mocha'
    

提交回复
热议问题