Commit b31b460f55f9464b6fc465a18e0e2153f0716f69
1 parent
b29ee282
Exists in
master
and in
1 other branch
add more specs for configurator
Showing
3 changed files
with
24 additions
and
2 deletions
Show diff stats
.env.default
@@ -18,5 +18,4 @@ MONGO_URL='mongodb://localhost' | @@ -18,5 +18,4 @@ MONGO_URL='mongodb://localhost' | ||
18 | GITHUB_URL='https://github.com' | 18 | GITHUB_URL='https://github.com' |
19 | GITHUB_AUTHENTICATION=true | 19 | GITHUB_AUTHENTICATION=true |
20 | GITHUB_ACCESS_SCOPE='[repo]' | 20 | GITHUB_ACCESS_SCOPE='[repo]' |
21 | -EMAIL_DELIVERY_METHOD=sendmail | ||
22 | DEVISE_MODULES='[database_authenticatable,recoverable,rememberable,trackable,validatable,omniauthable]' | 21 | DEVISE_MODULES='[database_authenticatable,recoverable,rememberable,trackable,validatable,omniauthable]' |
docs/configuration.md
@@ -75,7 +75,6 @@ In order of precedence Errbit uses: | @@ -75,7 +75,6 @@ In order of precedence Errbit uses: | ||
75 | <dd>defaults to [repo] | 75 | <dd>defaults to [repo] |
76 | <dt>EMAIL_DELIVERY_METHOD | 76 | <dt>EMAIL_DELIVERY_METHOD |
77 | <dd>:smtp or :sendmail, depending on how you want Errbit to send email | 77 | <dd>:smtp or :sendmail, depending on how you want Errbit to send email |
78 | -<dd>defaults to :sendmail | ||
79 | <dt>SMTP_SERVER | 78 | <dt>SMTP_SERVER |
80 | <dd>Server address for outgoing SMTP messages | 79 | <dd>Server address for outgoing SMTP messages |
81 | <dt>SMTP_PORT | 80 | <dt>SMTP_PORT |
spec/lib/configurator_spec.rb
@@ -34,4 +34,28 @@ describe Configurator do | @@ -34,4 +34,28 @@ describe Configurator do | ||
34 | }) | 34 | }) |
35 | expect(result.one).to eq('zoom') | 35 | expect(result.one).to eq('zoom') |
36 | end | 36 | end |
37 | + | ||
38 | + it 'extracts symbol values' do | ||
39 | + allow(ENV).to receive(:[]).with('MYSYMBOL').and_return(':asymbol') | ||
40 | + result = Configurator.run({ mysymbol: ['MYSYMBOL'] }) | ||
41 | + expect(result.mysymbol).to be(:asymbol) | ||
42 | + end | ||
43 | + | ||
44 | + it 'extracts array values' do | ||
45 | + allow(ENV).to receive(:[]).with('MYARRAY').and_return('[one,two,three]') | ||
46 | + result = Configurator.run({ myarray: ['MYARRAY'] }) | ||
47 | + expect(result.myarray).to eq(['one', 'two', 'three']) | ||
48 | + end | ||
49 | + | ||
50 | + it 'extracts booleans' do | ||
51 | + allow(ENV).to receive(:[]).with('MYBOOLEAN').and_return('true') | ||
52 | + result = Configurator.run({ myboolean: ['MYBOOLEAN'] }) | ||
53 | + expect(result.myboolean).to be(true) | ||
54 | + end | ||
55 | + | ||
56 | + it 'extracts numbers' do | ||
57 | + allow(ENV).to receive(:[]).with('MYNUMBER').and_return('0') | ||
58 | + result = Configurator.run({ mynumber: ['MYNUMBER'] }) | ||
59 | + expect(result.mynumber).to be(0) | ||
60 | + end | ||
37 | end | 61 | end |