conker 0.14.1 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- data/conker.gemspec +1 -1
- data/lib/conker.rb +1 -1
- data/spec/fixtures/hash.yml +4 -0
- data/spec/lib/conker_spec.rb +29 -4
- metadata +3 -2
data/conker.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'conker'
|
3
3
|
s.authors = ['Sam Stokes', 'Conrad Irwin', 'Lee Mallabone', 'Martin Kleppmann']
|
4
4
|
s.email = 'supportive@rapportive.com'
|
5
|
-
s.version = '0.14.
|
5
|
+
s.version = '0.14.2'
|
6
6
|
s.summary = %q{Conker will conquer your config.}
|
7
7
|
s.description = "Configuration library."
|
8
8
|
s.homepage = "https://github.com/rapportive/conker"
|
data/lib/conker.rb
CHANGED
data/spec/lib/conker_spec.rb
CHANGED
@@ -7,6 +7,10 @@ describe Conker do
|
|
7
7
|
@constants = Kernel.constants
|
8
8
|
end
|
9
9
|
|
10
|
+
def fixture(filename)
|
11
|
+
File.join(File.dirname(__FILE__), '..', 'fixtures', filename)
|
12
|
+
end
|
13
|
+
|
10
14
|
after :each do
|
11
15
|
# Don't need to worry about changing (rather than adding) constants,
|
12
16
|
# because Ruby will whinge if we do that.
|
@@ -45,6 +49,31 @@ describe Conker do
|
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
52
|
+
describe 'type: :hash' do
|
53
|
+
before do
|
54
|
+
fixture_path = fixture('hash.yml')
|
55
|
+
Conker.module_eval do
|
56
|
+
setup_config! :development, fixture_path,
|
57
|
+
CERTIFICATES: optional(type: :hash, default: {})
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should allow indifferent access to symbols' do
|
62
|
+
::CERTIFICATES[:foobar1].should == 'a'
|
63
|
+
::CERTIFICATES['foobar1'].should == 'a'
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'should allow indifferent access to strings' do
|
67
|
+
::CERTIFICATES[:foobar2].should == 'b'
|
68
|
+
::CERTIFICATES['foobar2'].should == 'b'
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'should allow indifferent access to string that look like symbols' do
|
72
|
+
::CERTIFICATES[:foobar3].should == 'c'
|
73
|
+
::CERTIFICATES['foobar3'].should == 'c'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
48
77
|
describe 'reading config from a hash' do
|
49
78
|
describe 'basic usage' do
|
50
79
|
def setup!(env = :development, config = {})
|
@@ -305,10 +334,6 @@ describe Conker do
|
|
305
334
|
|
306
335
|
|
307
336
|
describe 'reading config from a YAML file' do
|
308
|
-
def fixture(filename)
|
309
|
-
File.join(File.dirname(__FILE__), '..', 'fixtures', filename)
|
310
|
-
end
|
311
|
-
|
312
337
|
describe 'basic usage' do
|
313
338
|
def setup!(env = :development, filename = 'empty.yml')
|
314
339
|
fixture_path = fixture(filename)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-
|
15
|
+
date: 2013-10-02 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/conker.rb
|
77
77
|
- open-source-TODO.txt
|
78
78
|
- spec/fixtures/empty.yml
|
79
|
+
- spec/fixtures/hash.yml
|
79
80
|
- spec/fixtures/port_3000.yml
|
80
81
|
- spec/lib/conker_spec.rb
|
81
82
|
homepage: https://github.com/rapportive/conker
|