エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
What is the best way to write specs for code that depends on environment variables?
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
What is the best way to write specs for code that depends on environment variables?
I am testing some code that pulls its configuration from environment variables (set by Heroku con... I am testing some code that pulls its configuration from environment variables (set by Heroku config vars in production, for local development I use foreman). What's the best way to test this kind of code with RSpec? I came up with this: before :each do ENV.stub(:[]).with("AWS_ACCESS_KEY_ID").and_return("asdf") ENV.stub(:[]).with("AWS_SECRET_ACCESS_KEY").and_return("secret") end If you don't need



2014/05/27 リンク