File: testing.html.md

package info (click to toggle)
ruby-dry-configurable 0.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 184 kB
  • sloc: ruby: 397; makefile: 4
file content (27 lines) | stat: -rw-r--r-- 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
title: Testing
layout: gem-single
name: dry-configurable
---

### How to reset the config to its original state on testing environment

update `spec_helper.rb` :

```ruby
require "dry/configurable/test_interface"

# this is your module/class that extended by Dry::Configurable
module AwesomeModule
  enable_test_interface
end
```

and on spec file (`xxx_spec.rb`) :

```ruby 
before(:all) { AwesomeModule.reset_config }
# or 
before(:each) { AwesomeModule.reset_config }

```