trinidad_init_services 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -313,6 +313,7 @@ module Trinidad
313
313
  def ask=(flag)
314
314
  @ask = !!flag
315
315
  end
316
+ public :ask=
316
317
 
317
318
  def say(msg)
318
319
  puts msg unless @say == false
@@ -321,6 +322,7 @@ module Trinidad
321
322
  def say=(flag)
322
323
  @say = !!flag
323
324
  end
325
+ public :say=
324
326
 
325
327
  end
326
328
  end
@@ -1,5 +1,5 @@
1
1
  module Trinidad
2
2
  module InitServices
3
- VERSION = '1.2.0'
3
+ VERSION = '1.2.1'
4
4
  end
5
5
  end
@@ -156,6 +156,25 @@ describe Trinidad::InitServices::Configuration do
156
156
  }x
157
157
  end
158
158
 
159
+ it "ask= forces trinidad to not ask on tty" do
160
+ subject.ask = false
161
+ outcome = subject.send :ask, 'hello?', :there
162
+ outcome.should == :there
163
+
164
+ outcome = subject.send :ask, 'de-ja-vu?', nil
165
+ outcome.should be nil
166
+ end
167
+
168
+ it "say= silences standard output" do
169
+ def subject.puts(msg)
170
+ raise msg
171
+ end
172
+ lambda { subject.send :say, 'hello' }.should raise_error
173
+
174
+ subject.say = false
175
+ lambda { subject.send :say, 'hello' }.should_not raise_error
176
+ end
177
+
159
178
  private
160
179
 
161
180
  def config_defaults
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: trinidad_init_services
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.0
5
+ version: 1.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Calavera
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-09-03 00:00:00 Z
13
+ date: 2012-09-06 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: trinidad