How to use let variables in rails console?
问题 using rspec 2.6.4 rails 3.1.6 How to use let variables in rails test console? 1.9.3-p0 :032 > let(:user) { create(:user) } NoMethodError: undefined method `let' for main:Object Please advise, which library should be required here? For example: below is executed in console to use stub methods in console. require 'rspec/mocks/standalone' Is it possible, to define and call let variables in rails console? 回答1: If you are fine with let just creating globals, you can polyfill it like this: def let