File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,9 @@ def strict
5656 end
5757
5858 def strict_string
59- if Settings . strict . is_a? String
60- Settings . strict
61- elsif Settings . strict
59+ if strict . is_a? String
60+ strict
61+ elsif strict
6262 'set -euo pipefail'
6363 else
6464 'set -e'
Original file line number Diff line number Diff line change 11require 'spec_helper'
22
33describe Settings do
4- subject { described_class }
4+ subject { BaselineSettings . clone }
55
66 describe 'standard value' do
77 it 'returns a predefined default value' do
88 expect ( subject . tab_indent ) . to be false
99 end
1010
1111 context 'when settings.yml exists' do
12- original_value = described_class . source_dir
13-
1412 before do
1513 reset_tmp_dir
1614 File . write 'spec/tmp/settings.yml' , 'source_dir: somedir'
1715 subject . source_dir = nil
1816 end
1917
20- after { described_class . source_dir = original_value }
21-
2218 it 'returns the value from the settings file' do
2319 Dir . chdir 'spec/tmp' do
2420 expect ( subject . source_dir ) . to eq 'somedir'
2723 end
2824
2925 context 'when bashly-settings.yml exists' do
30- original_value = described_class . source_dir
31-
3226 before do
3327 reset_tmp_dir
3428 File . write 'spec/tmp/bashly-settings.yml' , 'source_dir: somedir'
3529 subject . source_dir = nil
3630 end
3731
38- after { described_class . source_dir = original_value }
39-
4032 it 'returns the value from the settings file' do
4133 Dir . chdir 'spec/tmp' do
4234 expect ( subject . source_dir ) . to eq 'somedir'
9385 end
9486
9587 describe 'strict_string' do
96- original_value = described_class . strict
97-
98- after { subject . strict = original_value }
99-
10088 context 'when strict is true' do
10189 before { subject . strict = true }
10290
Original file line number Diff line number Diff line change 3434Settings . env = :development
3535reset_tmp_dir
3636
37+ # This is used in the Settings spec, to ensure we are working with an
38+ # eigenclass that has a known state
39+ BaselineSettings = Settings . clone
40+
3741# Consistent Colsole output (for rspec_fixtures)
3842ENV [ 'TTY' ] = 'off'
3943ENV [ 'COLUMNS' ] = '80'
You can’t perform that action at this time.
0 commit comments