# プラグインのRubyテスト作成に関するアドバイス

**URL:** <https://meta.discourse.org/t/advice-on-writing-ruby-tests-for-plugins/108110>\
**Category:** Development\
**Created:** [2019 年 2 月 1 日午前 9:52 UTC](https://meta.discourse.org/t/advice-on-writing-ruby-tests-for-plugins/108110 "2019-02-01T09:52:27Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![kleinfreund](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kleinfreund](https://meta.discourse.org/u/kleinfreund)\
**Post date:** [2019 年 2 月 1 日午後 12:49 UTC](https://meta.discourse.org/t/advice-on-writing-ruby-tests-for-plugins/108110/13 "2019-02-01T12:49:49Z")

</div>

Ah, thank your for clearing that up. My `RAILS_ENV` was set to development, so the tests were running in development mode, too. After unsetting that, it uses the test environment by default. If one wants to enforce a test environment for the tests, they can run this:

```sh
RAILS_ENV=test bundle exec rake plugin:spec["my-plugin-dir"]

```

---

_[View the full topic](https://meta.discourse.org/t/advice-on-writing-ruby-tests-for-plugins/108110)._
