endeco 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ module Endeco
25
25
  end
26
26
  end
27
27
  end
28
- value.chomp! if value && !(options[:chomp] === false) && Config.default_chomp
28
+ value.chomp! if value && (!options[:chomp].nil? ? options[:chomp] : Config.default_chomp)
29
29
  value
30
30
  end
31
31
 
@@ -1,3 +1,3 @@
1
1
  module Endeco
2
- VERSION = "0.0.4"
2
+ VERSION = '0.0.5'
3
3
  end
@@ -98,19 +98,43 @@ describe Endeco do
98
98
  end
99
99
  end
100
100
 
101
- context 'enable default chomp' do
101
+ describe 'chomp option' do
102
102
  include_context 'file prepared'
103
103
 
104
- before do
105
- Endeco::Config.default_chomp = true
106
- end
104
+ context 'enable default chomp' do
105
+ before do
106
+ Endeco::Config.default_chomp = true
107
+ end
107
108
 
108
- it 'remove line feed' do
109
- Endeco.test_var.should eq 'hoge'
109
+ context 'not use chomp option' do
110
+ it 'remove line feed' do
111
+ Endeco.test_var.should eq 'hoge'
112
+ end
113
+ end
114
+
115
+ context 'use chomp option' do
116
+ it 'disable chomp with option' do
117
+ Endeco.test_var(:chomp => false).should eq "hoge\n"
118
+ end
119
+ end
110
120
  end
111
121
 
112
- it 'disable chomp with option' do
113
- Endeco.test_var(:chomp => false).should eq "hoge\n"
122
+ context 'disable default chomp' do
123
+ before do
124
+ Endeco::Config.default_chomp = false
125
+ end
126
+
127
+ context 'not use chomp option' do
128
+ it 'disable chomp with option' do
129
+ Endeco.test_var.should eq "hoge\n"
130
+ end
131
+ end
132
+
133
+ context 'use chomp option' do
134
+ it 'remove line feed' do
135
+ Endeco.test_var(:chomp => true).should eq "hoge"
136
+ end
137
+ end
114
138
  end
115
139
  end
116
140
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: endeco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2013-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
+ prerelease: false
16
17
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
+ none: false
22
23
  type: :development
23
- prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
25
  requirements:
27
26
  - - ! '>='
28
27
  - !ruby/object:Gem::Version
29
28
  version: '0'
29
+ none: false
30
30
  description: Environment Dependent Configuration
31
31
  email:
32
32
  - hawk@at-exit.com
@@ -57,17 +57,17 @@ rdoc_options: []
57
57
  require_paths:
58
58
  - lib
59
59
  required_ruby_version: !ruby/object:Gem::Requirement
60
- none: false
61
60
  requirements:
62
61
  - - ! '>='
63
62
  - !ruby/object:Gem::Version
64
63
  version: '0'
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
64
  none: false
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
66
  requirements:
68
67
  - - ! '>='
69
68
  - !ruby/object:Gem::Version
70
69
  version: '0'
70
+ none: false
71
71
  requirements: []
72
72
  rubyforge_project: endeco
73
73
  rubygems_version: 1.8.24