Class: SignalEmitterTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/puppet/external/event-loop/signal-system.rb

Defined Under Namespace

Classes: X

Instance Method Summary collapse

Instance Method Details

#setupObject



178
179
180
# File 'lib/puppet/external/event-loop/signal-system.rb', line 178

def setup
  @x = X.new
end

#test_multiple_on_fooObject



206
207
208
209
210
211
212
213
214
# File 'lib/puppet/external/event-loop/signal-system.rb', line 206

def test_multiple_on_foo
  moomin = 0
  @x.on_foo { moomin += 1 }
  @x.on_foo { moomin += 2 }
  @x.on_foo { moomin += 4 }
  @x.on_foo { moomin += 8 }
  @x.signal :foo
  assert moomin == 15
end

#test_multiple_on_signalObject



196
197
198
199
200
201
202
203
204
# File 'lib/puppet/external/event-loop/signal-system.rb', line 196

def test_multiple_on_signal
  moomin = 0
  @x.on_signal(:foo) { moomin += 1 }
  @x.on_signal(:foo) { moomin += 2 }
  @x.on_signal(:foo) { moomin += 4 }
  @x.on_signal(:foo) { moomin += 8 }
  @x.signal :foo
  assert moomin == 15
end

#test_on_fooObject



189
190
191
192
193
194
# File 'lib/puppet/external/event-loop/signal-system.rb', line 189

def test_on_foo
  moomin = 0
  @x.on_foo { moomin = 1 }
  @x.signal :foo
  assert moomin == 1
end

#test_on_signalObject



182
183
184
185
186
187
# File 'lib/puppet/external/event-loop/signal-system.rb', line 182

def test_on_signal
  moomin = 0
  @x.on_signal(:foo) { moomin = 1 }
  @x.signal :foo
  assert moomin == 1
end