LoginSignup
0
1

More than 5 years have passed since last update.

webmockが勝手にrequireされないようにする

Posted at

Problem

RspecでAPIのスタブを作成するためにwebmockを導入したら、specを実行してない時にも勝手にスタブが有効になり、apiアクセスが出来なくなった。

Solution

Gemfileに書いたgemは勝手にrequireされるようです。そして、webmockはrequireされると勝手にスタブをつくるため、apiアクセスが出来なくなります。

requireしたくない場合は、require: falseオプションをつけます。

# Gemfile: 

gem 'webmock', require: false
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1