макет Rails.env.development? используя rspec

Я пишу модульный тест, используя rspec.

Я хотел бы издеваться над Rails.env.develepment? вернуть истину. Как я мог этого добиться?

Я пробовал это

Rails.env.stub(:development?, nil).and_return(true)

это выдает эту ошибку

activesupport-4.0.0/lib/active_support/string_inquirer.rb:22:in `method_missing': undefined method `any_instance' for "test":ActiveSupport::StringInquirer (NoMethodError)

Обновление ruby версии ruby-2.0.0-p353, rails 4.0.0, rspec 2.11

describe "welcome_signup" do
    let(:mail) { Notifier.welcome_signup user }

    describe "in dev mode" do
      Rails.env.stub(:development?, nil).and_return(true)
      let(:mail) { Notifier.welcome_signup user }
      it "send an email to" do
        expect(mail.to).to eq([GlobalConstants::DEV_EMAIL_ADDRESS])
      end
    end
  end

Ответы на вопрос(2)

Ваш ответ на вопрос